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