This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Méthodologie : http://blog.adrienvh.fr/2014/04/09/calculer-le-rayon-de-cercles-proportionnels/ | |
*/ | |
// Distribution statistique | |
var distribution = [25, 46, 2, 39, 30, 21, 3, 19, 15, 5]; // http://www.random.org/integer-sets/ | |
var valeur_min = Math.min.apply(Math, distribution); | |
var valeur_max = Math.max.apply(Math, distribution); | |
// Calcul du rayon (diamètre minimal fixé) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pré-requis : charger la librairie Google Maps, son module Geometry, et la librairie OpenLayers : | |
<script src="https://maps.googleapis.com/maps/api/js?key=...&libraries=geometry&sensor=false"></script> | |
<script src="http://openlayers.org/api/OpenLayers.js"></script> | |
*/ | |
// Carte | |
var cartographie = new OpenLayers.Map('carte'); // <div id="carte"></div> | |
var couche_osm = new OpenLayers.Layer.OSM('OSM'); | |
cartographie.addLayer(couche_osm); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Pré-requis : charger la librairie Google Maps : | |
<script src="https://maps.googleapis.com/maps/api/js?key=...&sensor=false"></script> | |
*/ | |
// Adresses | |
var origin = '191 rue Saint-Jacques, Paris'; | |
var destination = '37 bd Romain Rolland, Montrouge'; | |
// Itinéraire |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://maps.googleapis.com/maps/api/directions/json?'; | |
// Adresses | |
$origin = '191 rue Saint-Jacques, Paris'; | |
$destination = '37 bd Romain Rolland, Montrouge'; | |
// Itinéraire | |
$params = http_build_query(array('origin' => $origin, 'destination' => $destination, 'sensor' => 'false')); | |
$appel_api = file_get_contents($url.$params); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$url = 'http://nominatim.openstreetmap.org/search?'; | |
// Adresses | |
$adresses[] = '191 rue Saint-Jacques, Paris'; | |
$adresses[] = 'Parc des Buttes Chaumont, Paris'; | |
$adresses[] = '37 bd Romain Rolland, Montrouge'; | |
// Géocodage | |
foreach($adresses as $adresse) |