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 different layers

Tutorials

>

Tutorial Maps

>

Tutorial : LeafLetJS Maps with different layers


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

Tutorial : LeafLetJS Maps with different layers:



Go back to tutorial of the componant Maps



Source code

Source code


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",
            
"&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> &copy; ".
            
"<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",
            
"&copy; <a href=\"http://www.thunderforest.com/\">Thunderforest</a>, &copy; ".
        
"<a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a>");

        
$this->render->add($map1$map2$map3);
    }
}
?>


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