File: /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); } } ?>
Go back to tutorial of the componant Maps
|