|
Tutoriel 1 : LeafLetJS Maps
Fichier: /pages/tutorials/maps/maps-01.php
<?php class Maps01 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : LeafLetJS Maps"; $this->render = new MapLeafLet(); } } ?>
Tutoriel 2 : LeafLetJS Maps with address marker
Fichier: /pages/tutorials/maps/maps-02.php
<?php class Maps02 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : LeafLetJS Maps with address marker"; $this->render = new MapLeafLet("map_white_house"); $this->render->setGeoSearchTool(MapLeafLet::GEOSEARCH_OPENSTREETMAP); $this->render->addMarker("600 Pennsylvania Ave NW, Washington, DC 20500, United states", "White House"); } } ?>
Tutoriel 3 : LeafLetJS Maps with multiple random markers
Fichier: /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); } } ?>
Tutoriel 4 : LeafLetJS Maps with different layers
Fichier: /pages/tutorials/maps/maps-04.php
<?php class Maps04 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : LeafLetJS Maps with different layers";
// You can find different layers on this page: // http://leaflet-extras.github.io/leaflet-providers/preview/
$this->render = new WSPObject();
// Default layer $map1 = new MapLeafLet("map04_1"); $map1->addMarker("Paris France", "Paris"); $map1->setZoom(5);
// Modify default layer $map2 = new MapLeafLet("map04_2"); $map2->addMarker("Paris France", "Paris"); $map2->setZoom(5); $map2->setTileLayer("http://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png", "© <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> © ". "<a href=\"http://cartodb.com/attributions\">CartoDB</a>");
// Use 2 layers (tiles) $map3 = new MapLeafLet("map04_3"); $map3->addMarker("Paris France", "Paris"); $map3->setZoom(5); $map3->setTileLayer("http://{s}.tile.thunderforest.com/spinal-map/{z}/{x}/{y}.png", "Tiles Courtesy of <a href=\"http://www.mapquest.com/\">MapQuest</a>"); $map3->addTileLayer("http://{s}.tile.stamen.com/toner-lines/{z}/{x}/{y}.png", "© <a href=\"http://www.thunderforest.com/\">Thunderforest</a>, © ". "<a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>");
$this->render->add($map1, $map2, $map3); } } ?>
Tutoriel 5 : LeafLetJS Maps with different layers and layers controler
Fichier: /pages/tutorials/maps/maps-05.php
<?php class Maps05 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : LeafLetJS Maps with different layers and layers controler";
// You can find different layers on this page: // http://leaflet-extras.github.io/leaflet-providers/preview/
$this->render = new MapLeafLet("map05"); $this->render->setHeight(600)->setWidth(500); $this->render->addMarker("Paris France", "Paris"); $this->render->setZoom(5); $this->render->setTileLayer("http://{s}.tile.stamen.com/watercolor/{z}/{x}/{y}.png", "Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, ". "<a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> — Map data ". "© <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>", "Map 1", MapLeafLet::TILE_LAYER_CTRL_RADIO); $this->render->addTileLayer("http://otile4.mqcdn.com/tiles/1.0.0/osm/{z}/{x}/{y}.png", "", "Map 2", MapLeafLet::TILE_LAYER_CTRL_RADIO, false); $this->render->addTileLayer("http://openmapsurfer.uni-hd.de/tiles/adminb/x={x}&y={y}&z={z}", "Imagery from <a href=\"http://giscience.uni-hd.de/\">GIScience Research Group @ University ". "of Heidelberg</a> — Map data © <a href=\"http://www.openstreetmap.org/copyright\">". "OpenStreetMap</a>", "Admin bounds"); $this->render->addTileLayer("http://{s}.tile.stamen.com/toner-lines/{z}/{x}/{y}.png", "Map tiles by <a href=\"http://stamen.com\">Stamen Design</a>, ". "<a href=\"http://creativecommons.org/licenses/by/3.0\">CC BY 3.0</a> — Map data ". "© <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>", "Border lines"); } } ?>
|
|
|
|
|