|
|
|
@ -26,12 +26,12 @@
|
|
|
|
|
defaut=0,
|
|
|
|
|
size=2,
|
|
|
|
|
maxlength=2})]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#SET{layers,#ARRAY}
|
|
|
|
|
<BOUCLE_layer(DATA){source table, #EVAL{$GLOBALS['gis_layers']}}>
|
|
|
|
|
#SET{layers,#GET{layers}|array_merge{#ARRAY{#CLE,#VALEUR|table_valeur{nom}}}}
|
|
|
|
|
</BOUCLE_layer>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(#SET{layer_defaut,openstreetmap_mapnik})]
|
|
|
|
|
[(#VAL{_GIS_LAYER_DEFAUT}|defined|oui)
|
|
|
|
|
[(#SET{layer_defaut,[(#EVAL{_GIS_LAYER_DEFAUT})]})]
|
|
|
|
@ -50,41 +50,41 @@
|
|
|
|
|
readonly=#GET{layer_readonly},
|
|
|
|
|
disable=#GET{layer_disable},
|
|
|
|
|
explication=#GET{layer_explications},
|
|
|
|
|
datas=#GET{layers}})]
|
|
|
|
|
data=#GET{layers}})]
|
|
|
|
|
[(#SAISIE{selection_multiple,layers,
|
|
|
|
|
label=<:gis:cfg_lbl_layers:>,
|
|
|
|
|
cacher_option_intro=oui,
|
|
|
|
|
defaut=#GET{layer_defaut},
|
|
|
|
|
explication=[(#ENV*{layers,#LISTE}|count|singulier_ou_pluriel{gis:explication_layers_un,gis:explication_layers})],
|
|
|
|
|
datas=#GET{layers}})]
|
|
|
|
|
|
|
|
|
|
data=#GET{layers}})]
|
|
|
|
|
|
|
|
|
|
[(#SAISIE{input,api_key_bing,
|
|
|
|
|
label=<:gis:cfg_lbl_api_key_bing:>,
|
|
|
|
|
explication=<:gis:cfg_inf_bing{url=https://www.bingmapsportal.com/}:>,
|
|
|
|
|
size=40})]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(#SAISIE{input,api_key_google,
|
|
|
|
|
label=<:gis:cfg_lbl_api_key_google:>,
|
|
|
|
|
explication=<:gis:cfg_inf_google{url=https://developers.google.com/maps/documentation/javascript/get-api-key}:>,
|
|
|
|
|
size=40})]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(#SAISIE{oui_non,geocoder,
|
|
|
|
|
defaut='',
|
|
|
|
|
label=<:gis:cfg_lbl_geocoder:>,
|
|
|
|
|
explication=<:gis:cfg_inf_geocoder:>})]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(#SAISIE{oui_non,adresse,
|
|
|
|
|
defaut='',
|
|
|
|
|
label=<:gis:cfg_lbl_adresse:>,
|
|
|
|
|
explication=<:gis:cfg_inf_adresse:>})]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(#PLUGIN{gisgeom}|oui)
|
|
|
|
|
[(#SAISIE{oui_non,styles,
|
|
|
|
|
defaut='',
|
|
|
|
|
label=<:gis:cfg_lbl_styles:>,
|
|
|
|
|
explication=<:gis:cfg_inf_styles:>})]
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[(#SAISIE{oui_non,geolocaliser_user_html5,
|
|
|
|
|
defaut='',
|
|
|
|
|
label=<:gis:cfg_lbl_geolocaliser_user_html5:>,
|
|
|
|
@ -100,7 +100,7 @@
|
|
|
|
|
explication=<:gis:explication_plugins_desactives:>,
|
|
|
|
|
multiple=oui,
|
|
|
|
|
size=6,
|
|
|
|
|
datas=#ARRAY{
|
|
|
|
|
data=#ARRAY{
|
|
|
|
|
'KML.js','KML.js',
|
|
|
|
|
'GPX.js','GPX.js',
|
|
|
|
|
'TOPOJSON.js','TOPOJSON.js',
|
|
|
|
@ -121,7 +121,7 @@
|
|
|
|
|
|
|
|
|
|
(function($){
|
|
|
|
|
var map, map_container = 'map_config', geocoder, marker;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var maj_inputs = function(map,pos,action) {
|
|
|
|
|
if(action == 'click'){
|
|
|
|
|
var zoom = map.getZoom();
|
|
|
|
@ -143,7 +143,7 @@
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function geocode(query) {
|
|
|
|
|
if(!query.error)
|
|
|
|
|
maj_inputs(map,query,'geocoding');
|
|
|
|
@ -158,14 +158,14 @@
|
|
|
|
|
|
|
|
|
|
var init_config = function() {
|
|
|
|
|
map = new L.Map(map_container);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
map.attributionControl.setPrefix('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//default layer
|
|
|
|
|
#SET{layer_defaut,#REM|gis_layer_defaut} #SET{layers,#EVAL{$GLOBALS['gis_layers']}}
|
|
|
|
|
var [(#GET{layer_defaut})] = [new (#GET{layers}|table_valeur{#GET{layer_defaut}/layer})];
|
|
|
|
|
map.addLayer([(#GET{layer_defaut})]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<B_layers>
|
|
|
|
|
var layers_control = new L.Control.Layers();
|
|
|
|
|
layers_control.addBaseLayer([(#GET{layer_defaut})],["(#GET{layers}|table_valeur{#GET{layer_defaut}/nom})"]);
|
|
|
|
@ -182,9 +182,9 @@
|
|
|
|
|
|
|
|
|
|
marker = new L.Marker(new L.LatLng(#ENV{lat,0},#ENV{lon,0}));
|
|
|
|
|
map.addLayer(marker);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
geocoder = new L.Geocoder(geocode,{acceptLanguage:'#ENV{lang}'});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// mettre a jour les coordonnees quand on clique la carte
|
|
|
|
|
map.on('click', function(e) {
|
|
|
|
|
annuler_geocoder = 0;
|
|
|
|
@ -192,14 +192,14 @@
|
|
|
|
|
map.panTo(e.latlng);
|
|
|
|
|
maj_inputs(map,e.latlng,'click');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// geocoder si clic...
|
|
|
|
|
$('a#map_config_rechercher_geocodage').css("cursor","pointer").click(function(){
|
|
|
|
|
var address = $("#champ_map_config_geocoder").val();
|
|
|
|
|
annuler_geocoder = 0;
|
|
|
|
|
geocoder.geocode(address);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ne pas soumettre le formulaire si on presse Entree depuis le champ de recherche
|
|
|
|
|
$('#champ_map_config_geocoder').keypress(function(e){
|
|
|
|
|
if (e.which == 13) {
|
|
|
|
@ -207,7 +207,7 @@
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// mettre à jour le zoom quand on le modifie
|
|
|
|
|
map.on('zoomend', function(e) {
|
|
|
|
|
$("#champ_zoom").val(e.target._zoom);
|
|
|
|
|