WebSite-PHP Framework PHP
Multi language
Simple Ajax mode
No HTML, no JavaScript
URL rewriting
Mail sending
Sitemap - RSS - Web service
Download WebSite-PHP FrameWork now
 


Loading
 


Tutorial : LeafLetJS Maps
            with multiple random markers

Tutorials

>

Tutorial Maps

>

Tutorial : LeafLetJS Maps with multiple random markers


Maps-03: Tutorial of the composant Maps of the PHP FrameWork WebSite-PHP.

Tutorial : LeafLetJS Maps with multiple random markers:



Go back to tutorial of the componant Maps



Source code

Source code


File: /pages/tutorials/maps/maps-03.php

<?php
class Maps03 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : LeafLetJS Maps
                    with multiple random markers"
;
        
        
$this->render = new MapLeafLet("map03");
        
$min_lat 180;$max_lat = -180;
        
$min_lng 180;$max_lng = -180;
        for (
$i=1$i <= 10$i++) {
            
$lat rand(-5050);
            
$lng rand(-5050);
            
$this->render->addLatitudeLongitudeMarker($lat$lng,
                
"Random marker ".$i." in the world");
            if (
$lat $min_lat) { $min_lat $lat; }
            if (
$lat $max_lat) { $max_lat $lat; }
            if (
$lng $min_lng) { $min_lng $lng; }
            if (
$lng $max_lng) { $max_lng $lng; }
        }
        
$this->render->setAutoZoom($min_lat$max_lat$min_lng$max_lng);
    }
}
?>


Go back to tutorial of the componant Maps


Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker