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(-50, 50); $lng = rand(-50, 50); $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
|