WebSite-PHP Framework PHP
Multi langues
Mode Ajax simple
Aucun HTML, aucun JavaScript
URL rewrinting
Envoi d'email
Sitemap - RSS - Web service
Télécharger le Framework WebSite-PHP maintenant
 


Loading
 


Tutorial : LeafLetJS Maps
            with different layers

Tutoriels

>

Tutoriel Maps

>

Tutorial : LeafLetJS Maps with different layers


Maps-04: Tutoriel du composants Maps du FrameWork PHP WebSite-PHP.

Tutorial : LeafLetJS Maps with different layers:



Retourner aux tutoriels du composants Maps



Code source

Code source


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 Object();

        
// 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);
    }
}
?>


Retourner aux tutoriels du composants Maps


Share

 


Copyright © 2009-2016 WebSite-PHP Framework PHP
Accueil Documentation Télécharger Quick start Tutoriels Wiki Issue Tracker