*/
function formulaires_configurer_gis_verifier_dist(){
$erreurs = array();
-
- if ((_request('layer_defaut') == 'bing_aerial') OR in_array('bing_aerial', _request('layers'))){
+ $layers = _request('layers');
+ if (!is_array($layers)) {
+ $layers = array();
+ }
+
+ if ((_request('layer_defaut') == 'bing_aerial') OR in_array('bing_aerial', $layers)){
$obligatoire = 'api_key_bing';
if (!_request($obligatoire)){
$erreurs[$obligatoire] = _T('info_obligatoire');
$layer_defaut = lire_config('gis/layer_defaut');
// Si on change la couche par défaut ou si une couche google est présente dans la conf, le formulaire ne doit pas etre traiter en ajax
if ((_request('layer_defaut') != $layer_defaut)
- OR (count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), _request('layers'))) > 0)
- OR (in_array('bing_aerial', _request('layers'))))
+ OR (count(array_intersect(array('google_roadmap', 'google_satellite', 'google_terrain'), $layers)) > 0)
+ OR (in_array('bing_aerial', $layers)))
refuser_traiter_formulaire_ajax();
}
* @param array $opt Des options
* @return boolean true/false
*/
-function autoriser_gis_iconifier_dist($faire,$quoi){
+function autoriser_gis_iconifier_dist($faire,$quoi,$id,$qui,$opts){
return autoriser('modifier','gis',$id,$qui,$opts);
}
}
return autoriser('modifier','gis',$id,$qui,$opts);
}
-?>
\ No newline at end of file
+?>
$props .= "\n\"popup_anchor\": ". json_encode(array(1,-$h/1.2));
}
- if ($shadow = find_in_path('images/marker_defaut_shadow.png'))
+ if ($shadow = find_in_path('images/marker_defaut_shadow.png')) {
$props .= ",\n\"shadow\": ". json_encode(url_absolue($shadow));
+ list($h,$w) = taille_image($shadow);
+ $props .= ",\n\"shadow_size\": ". json_encode(array($w,$h));
+ }
return $props;
}
$config = @unserialize($GLOBALS['meta']['gis']);
-$GLOBALS['gis_layers'] = array (
+$gis_layers = array (
'openstreetmap_mapnik' => array(
'nom' => 'OpenStreetMap',
'layer' => 'L.tileLayer.provider("OpenStreetMap")'
'layer' => 'L.Google("ROADMAP")'
),
'google_satellite' => array(
- 'nom' => 'Google Satelitte',
+ 'nom' => 'Google Satellite',
'layer' => 'L.Google("SATELLITE")'
),
'google_terrain' => array(
'nom' => 'Thunderforest Outdoors',
'layer' => 'L.tileLayer.provider("Thunderforest.Outdoors")'
),
+ 'opentopomap' => array(
+ 'nom' => 'OpenTopoMap',
+ 'layer' => 'L.tileLayer.provider("OpenTopoMap")'
+ ),
'openmapsurfer' => array(
'nom' => 'OpenMapSurfer',
'layer' => 'L.tileLayer.provider("OpenMapSurfer")'
)
);
-?>
\ No newline at end of file
+if (isset($GLOBALS['gis_layers']) and is_array($GLOBALS['gis_layers'])) {
+ $GLOBALS['gis_layers'] = array_merge($gis_layers,$GLOBALS['gis_layers']);
+} else {
+ $GLOBALS['gis_layers'] = $gis_layers;
+}
else {
place = response;
}
-
+
var street_components = [];
-
+
if (place.address.country) {
return_location.country = place.address.country;
}
*/
if (place.address.city) {
return_location.locality = place.address.city;
- }else if(place.address.county){
- street_components.push(place.address.pedestrian);
+ } else if (place.address.town) {
+ return_location.locality = place.address.town;
+ } else if (place.address.village) {
+ return_location.locality = place.address.village;
+ } else if (place.address.county) {
+ street_components.push(place.address.county);
}
if (place.address.postcode) {
return_location.postcode = place.address.postcode;
l = this.parsePlacemark(el[j], xml, style);
if (l) { layers.push(l); }
}
+ el = xml.getElementsByTagName('GroundOverlay');
+ for (var k = 0; k < el.length; k++) {
+ l = this.parseGroundOverlay(el[k]);
+ if (l) { layers.push(l); }
+ }
return layers;
},
var style = {};
var sl = xml.getElementsByTagName('Style');
- //for (var i = 0; i < sl.length; i++) {
- var attributes = {color: true, width: true, Icon: true, href: true,
- hotSpot: true};
+ var attributes = { color: true, width: true, Icon: true, href: true, hotSpot: true };
function _parse(xml) {
var options = {};
l = this.parsePlacemark(el[j], xml, style);
if (l) { layers.push(l); }
}
+ el = xml.getElementsByTagName('GroundOverlay');
+ for (var k = 0; k < el.length; k++) {
+ if (!this._check_folder(el[k], xml)) { continue; }
+ l = this.parseGroundOverlay(el[k]);
+ if (l) { layers.push(l); }
+ }
if (!layers.length) { return; }
if (layers.length === 1) { return layers[0]; }
return new L.FeatureGroup(layers);
},
parsePlacemark: function (place, xml, style) {
- var i, j, el, options = {};
+ var h, i, j, el, options = {};
+
+ var multi = ['MultiGeometry', 'MultiTrack', 'gx:MultiTrack'];
+ for (h in multi) {
+ el = place.getElementsByTagName(multi[h]);
+ for (i = 0; i < el.length; i++) {
+ return this.parsePlacemark(el[i], xml, style);
+ }
+ }
+
el = place.getElementsByTagName('styleUrl');
for (i = 0; i < el.length; i++) {
var url = el[i].childNodes[0].nodeValue;
}
var layers = [];
- var parse = ['LineString', 'Polygon', 'Point'];
+ var parse = ['LineString', 'Polygon', 'Point', 'Track', 'gx:Track'];
for (j in parse) {
- // for jshint
- if (true)
- {
- var tag = parse[j];
- el = place.getElementsByTagName(tag);
- for (i = 0; i < el.length; i++) {
- var l = this['parse' + tag](el[i], xml, options);
- if (l) { layers.push(l); }
- }
+ var tag = parse[j];
+ el = place.getElementsByTagName(tag);
+ for (i = 0; i < el.length; i++) {
+ var l = this['parse' + tag.replace(/gx:/, '')](el[i], xml, options);
+ if (l) { layers.push(l); }
}
}
return new L.Polyline(coords, options);
},
+ parseTrack: function (line, xml, options) {
+ var el = xml.getElementsByTagName('gx:coord');
+ if (el.length === 0) { el = xml.getElementsByTagName('coord'); }
+ var coords = [];
+ for (var j = 0; j < el.length; j++) {
+ coords = coords.concat(this._read_gxcoords(el[j]));
+ }
+ if (!coords.length) { return; }
+ return new L.Polyline(coords, options);
+ },
+
parsePoint: function (line, xml, options) {
var el = line.getElementsByTagName('coordinates');
if (!el.length) {
coords.push(new L.LatLng(ll[1], ll[0]));
}
return coords;
+ },
+
+ _read_gxcoords: function (el) {
+ var text = '', coords = [];
+ text = el.firstChild.nodeValue.split(' ');
+ coords.push(new L.LatLng(text[1], text[0]));
+ return coords;
+ },
+
+ parseGroundOverlay: function (xml) {
+ var latlonbox = xml.getElementsByTagName('LatLonBox')[0];
+ var bounds = new L.LatLngBounds(
+ [
+ latlonbox.getElementsByTagName('south')[0].childNodes[0].nodeValue,
+ latlonbox.getElementsByTagName('west')[0].childNodes[0].nodeValue
+ ],
+ [
+ latlonbox.getElementsByTagName('north')[0].childNodes[0].nodeValue,
+ latlonbox.getElementsByTagName('east')[0].childNodes[0].nodeValue
+ ]
+ );
+ var attributes = {Icon: true, href: true, color: true};
+ function _parse(xml) {
+ var options = {}, ioptions = {};
+ for (var i = 0; i < xml.childNodes.length; i++) {
+ var e = xml.childNodes[i];
+ var key = e.tagName;
+ if (!attributes[key]) { continue; }
+ var value = e.childNodes[0].nodeValue;
+ if (key === 'Icon') {
+ ioptions = _parse(e);
+ if (ioptions.href) { options.href = ioptions.href; }
+ } else if (key === 'href') {
+ options.href = value;
+ } else if (key === 'color') {
+ options.opacity = parseInt(value.substring(0, 2), 16) / 255.0;
+ options.color = '#' + value.substring(6, 8) + value.substring(4, 6) + value.substring(2, 4);
+ }
+ }
+ return options;
+ }
+ var options = {};
+ options = _parse(xml);
+ if (latlonbox.getElementsByTagName('rotation')[0] !== undefined) {
+ var rotation = latlonbox.getElementsByTagName('rotation')[0].childNodes[0].nodeValue;
+ options.rotation = parseFloat(rotation);
+ }
+ return new L.RotatedImageOverlay(options.href, bounds, {opacity: options.opacity, angle: options.rotation});
}
});
this.style.width = i.width + 'px';
this.style.height = i.height + 'px';
- if (this.anchorType.x === 'UNITS_FRACTION' || this.anchorType.x === 'fraction') {
+ if (this.anchorType.x === 'fraction' && this.anchorType.y === 'fraction') {
img.style.marginLeft = (-this.anchor.x * i.width) + 'px';
- }
- if (this.anchorType.y === 'UNITS_FRACTION' || this.anchorType.x === 'fraction') {
img.style.marginTop = (-(1 - this.anchor.y) * i.height) + 'px';
}
+ if (this.anchorType.x === 'pixels' && this.anchorType.y === 'pixels') {
+ img.style.marginLeft = (-this.anchor.x) + 'px';
+ img.style.marginTop = (this.anchor.y - i.height + 1) + 'px';
+ }
this.style.display = '';
};
return img;
}
});
+// Inspired by https://github.com/bbecquet/Leaflet.PolylineDecorator/tree/master/src
+L.RotatedImageOverlay = L.ImageOverlay.extend({
+ options: {
+ angle: 0
+ },
+ _reset: function () {
+ L.ImageOverlay.prototype._reset.call(this);
+ this._rotate();
+ },
+ _animateZoom: function (e) {
+ L.ImageOverlay.prototype._animateZoom.call(this, e);
+ this._rotate();
+ },
+ _rotate: function () {
+ if (L.DomUtil.TRANSFORM) {
+ // use the CSS transform rule if available
+ this._image.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.angle + 'deg)';
+ } else if(L.Browser.ie) {
+ // fallback for IE6, IE7, IE8
+ var rad = this.options.angle * (Math.PI / 180),
+ costheta = Math.cos(rad),
+ sintheta = Math.sin(rad);
+ this._image.style.filter += ' progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\'auto expand\', M11=' +
+ costheta + ', M12=' + (-sintheta) + ', M21=' + sintheta + ', M22=' + costheta + ')';
+ }
+ },
+ getBounds: function() {
+ return this._bounds;
+ }
+});
+
provider.url = provider.url(parts.splice(1, parts.length - 1).join('.'));
}
+ var forceHTTP = window.location.protocol === 'file:' || provider.options.forceHTTP;
+ if (provider.url.indexOf('//') === 0 && forceHTTP) {
+ provider.url = 'http:' + provider.url;
+ }
+
// replace attribution placeholders with their values from toplevel provider attribution,
// recursively
var attributionReplacer = function (attr) {
* see http://leafletjs.com/reference.html#tilelayer for options in the options map.
*/
- //jshint maxlen:220
L.TileLayer.Provider.providers = {
OpenStreetMap: {
- url: 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
+ url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
options: {
attribution:
'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
attribution: 'Map data: © <a href="http://www.openseamap.org">OpenSeaMap</a> contributors'
}
},
+ OpenTopoMap: {
+ url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
+ options: {
+ maxZoom: 16,
+ attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: © <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
+ }
+ },
Thunderforest: {
- url: 'http://{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
+ url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
options: {
attribution:
'© <a href="http://www.opencyclemap.org">OpenCycleMap</a>, {attribution.OpenStreetMap}',
variants: {
OpenCycleMap: 'cycle',
Transport: 'transport',
+ TransportDark: 'transport-dark',
Landscape: 'landscape',
Outdoors: 'outdoors'
}
variants: {
Full: 'full',
Base: 'base',
- RoadsAndLabels: 'roads_and_labels',
+ RoadsAndLabels: 'roads_and_labels'
}
},
MapQuestOpen: {
- url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpeg',
+ /* Mapquest does support https, but with a different subdomain:
+ * https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
+ * which makes implementing protocol relativity impossible.
+ */
+ url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
options: {
+ type: 'map',
+ ext: 'jpg',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> — ' +
'Map data {attribution.OpenStreetMap}',
variants: {
OSM: {},
Aerial: {
- url: 'http://oatile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',
options: {
+ type: 'sat',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> — ' +
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
}
+ },
+ HybridOverlay: {
+ options: {
+ type: 'hyb',
+ ext: 'png',
+ opacity: 0.9
+ }
}
}
},
MapBox: {
url: function (id) {
- return 'http://{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
+ return '//{s}.tiles.mapbox.com/v3/' + id + '/{z}/{x}/{y}.png';
},
options: {
attribution:
}
},
Stamen: {
- url: 'http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.png',
+ url: 'http://{s}.tile.stamen.com/{variant}/{z}/{x}/{y}.{ext}',
options: {
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, ' +
subdomains: 'abcd',
minZoom: 0,
maxZoom: 20,
- variant: 'toner'
+ variant: 'toner',
+ ext: 'png'
},
variants: {
Toner: 'toner',
TonerLines: 'toner-lines',
TonerLabels: 'toner-labels',
TonerLite: 'toner-lite',
+ Watercolor: {
+ options: {
+ variant: 'watercolor',
+ minZoom: 1,
+ maxZoom: 16
+ }
+ },
Terrain: {
options: {
variant: 'terrain',
minZoom: 4,
- maxZoom: 18
+ maxZoom: 18,
+ bounds: [[22, -132], [70, -56]]
}
},
TerrainBackground: {
options: {
variant: 'terrain-background',
minZoom: 4,
- maxZoom: 18
+ maxZoom: 18,
+ bounds: [[22, -132], [70, -56]]
}
},
- Watercolor: {
+ TopOSMRelief: {
options: {
- variant: 'watercolor',
- minZoom: 1,
- maxZoom: 16
+ variant: 'toposm-color-relief',
+ ext: 'jpg',
+ bounds: [[22, -132], [51, -56]]
+ }
+ },
+ TopOSMFeatures: {
+ options: {
+ variant: 'toposm-features',
+ bounds: [[22, -132], [51, -56]],
+ opacity: 0.9
}
}
}
},
Esri: {
- url: 'http://server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
+ url: '//server.arcgisonline.com/ArcGIS/rest/services/{variant}/MapServer/tile/{z}/{y}/{x}',
options: {
variant: 'World_Street_Map',
attribution: 'Tiles © Esri'
* envirionments.
*/
url:
- 'http://{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
+ '//{s}.{base}.maps.cit.api.here.com/maptile/2.1/' +
'maptile/{mapID}/{variant}/{z}/{x}/{y}/256/png8?' +
'app_id={app_id}&app_code={app_code}',
options: {
DarkMatter: 'dark_all',
DarkMatterNoLabels: 'dark_nolabels'
}
+ },
+ HikeBike: {
+ url: 'http://{s}.tiles.wmflabs.org/hikebike/{z}/{x}/{y}.png',
+ options: {
+ attribution: '{attribution.OpenStreetMap}'
+ }
+ },
+ BasemapAT: {
+ url: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
+ options: {
+ attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>',
+ subdomains: ['', '1', '2', '3', '4'],
+ bounds: [[46.358770, 8.782379], [49.037872, 17.189532]]
+ },
+ variants: {
+ basemap: {
+ options: {
+ variant: 'geolandbasemap',
+ format: 'jpeg'
+ }
+ },
+ highdpi: {
+ options: {
+ variant: 'bmaphidpi',
+ format: 'jpeg'
+ }
+ },
+ grau: {
+ options: {
+ variant: 'bmapgrau',
+ format: 'png'
+ }
+ },
+ overlay: {
+ options: {
+ variant: 'bmapoverlay',
+ format: 'png'
+ }
+ },
+ orthofoto: {
+ options: {
+ variant: 'bmaporthofoto30cm',
+ format: 'jpeg'
+ }
+ }
+ }
+ },
+ NASAGIBS: {
+ url: '//map1.vis.earthdata.nasa.gov/wmts-webmerc/{variant}/default/{time}/{tilematrixset}{maxZoom}/{z}/{y}/{x}.{format}',
+ options: {
+ attribution:
+ 'Imagery provided by services from the Global Imagery Browse Services (GIBS), operated by the NASA/GSFC/Earth Science Data and Information System ' +
+ '(<a href="https://earthdata.nasa.gov">ESDIS</a>) with funding provided by NASA/HQ.',
+ bounds: [[-85.0511287776, -179.999999975], [85.0511287776, 179.999999975]],
+ minZoom: 1,
+ maxZoom: 9,
+ format: 'jpg',
+ time: '',
+ tilematrixset: 'GoogleMapsCompatible_Level'
+ },
+ variants: {
+ ModisTerraTrueColorCR: 'MODIS_Terra_CorrectedReflectance_TrueColor',
+ ModisTerraBands367CR: 'MODIS_Terra_CorrectedReflectance_Bands367',
+ ViirsEarthAtNight2012: {
+ options: {
+ variant: 'VIIRS_CityLights_2012',
+ maxZoom: 8
+ }
+ },
+ ModisTerraLSTDay: {
+ options: {
+ variant: 'MODIS_Terra_Land_Surface_Temp_Day',
+ format: 'png',
+ maxZoom: 7,
+ opacity: 0.75
+ }
+ },
+ ModisTerraSnowCover: {
+ options: {
+ variant: 'MODIS_Terra_Snow_Cover',
+ format: 'png',
+ maxZoom: 8,
+ opacity: 0.75
+ }
+ },
+ ModisTerraAOD: {
+ options: {
+ variant: 'MODIS_Terra_Aerosol',
+ format: 'png',
+ maxZoom: 6,
+ opacity: 0.75
+ }
+ },
+ ModisTerraChlorophyll: {
+ options: {
+ variant: 'MODIS_Terra_Chlorophyll_A',
+ format: 'png',
+ maxZoom: 7,
+ opacity: 0.75
+ }
+ }
+ }
}
};
<BOUCLE_gis(GIS){objet ?}{id_objet ?}{id_gis ?}{0,1}>\r
<div id="map_preview" class="carte_gis" style="width: 100%; height: 150px;"></div>\r
-\r
+#SET{autocenter,''}\r
<script type="text/javascript">\r
/*<![CDATA[*/\r
(function($){\r
"id":"#ID_GIS",\r
"properties": {\r
"title":[(#TITRE|supprimer_numero|json_encode)],\r
- "description":[(#DESCRIPTIF|json_encode)][,(#LOGO_GIS|oui)\r
- [(#SET{logo_doc,#LOGO_GIS|image_passe_partout{28,28}|image_recadre{28,28}|image_recadre{32,32,center}|image_aplatir{jpg,ffffff}})]\r
- #SET{icon_w,#GET{logo_doc}|extraire_attribut{src}|largeur}\r
- #SET{icon_h,#GET{logo_doc}|extraire_attribut{src}|hauteur}\r
- ["icon": (#GET{logo_doc}|extraire_attribut{src}|url_absolue|json_encode)],\r
- "icon_size": \[#GET{icon_w},#GET{icon_h}\],\r
- "icon_anchor": \[[(#GET{icon_w}|div{2})],[(#GET{icon_h})]\],\r
- "popup_anchor": \[1,[-(#GET{icon_h}|div{1.2})]\]]\r
+ "description":[(#DESCRIPTIF|json_encode)][\r
+ (#LOGO_GIS|gis_icon_properties)]\r
}\r
}\r
</BOUCLE_points>\r
"id":"#ID_GIS",\r
"properties": {\r
"title":[(#TITRE|supprimer_numero|json_encode)],\r
- "description":[(#DESCRIPTIF|json_encode)][,(#LOGO_GIS|oui)\r
- [(#SET{logo_doc,#LOGO_GIS|image_passe_partout{28,28}|image_recadre{28,28}|image_recadre{32,32,center}|image_aplatir{jpg,ffffff}})]\r
- #SET{icon_w,#GET{logo_doc}|extraire_attribut{src}|largeur}\r
- #SET{icon_h,#GET{logo_doc}|extraire_attribut{src}|hauteur}\r
- ["icon": (#GET{logo_doc}|extraire_attribut{src}|url_absolue|json_encode)],\r
- "icon_size": \[#GET{icon_w},#GET{icon_h}\],\r
- "icon_anchor": \[[(#GET{icon_w}|div{2})],[(#GET{icon_h})]\],\r
- "popup_anchor": \[1,[-(#GET{icon_h}|div{1.2})]\]]\r
+ "description":[(#DESCRIPTIF|json_encode)][\r
+ (#LOGO_GIS|gis_icon_properties)]\r
}\r
}]\r
};\r
<paquet
prefix="gis"
categorie="divers"
- version="4.26.1"
+ version="4.26.10"
schema="2.0.7"
etat="stable"
compatibilite="[3.0.0;3.1.*]"
<div class="ajax">
+#SET{gis_defaut,''}
<BOUCLE_test(GIS){objet}{id_objet}{0,1}> </BOUCLE_test>
#SET{gis_defaut,nouveau}
#SET{gis_defaut,glop}
<tbody>
<BOUCLE_liste_gis(GIS){id_gis ?}{id_rubrique ?}{id_article ?}{id_breve ?}{id_document ?}{id_mot ?}{id_auteur ?}{id_syndic ?}{where?}{recherche?}{tri #ENV{par,multi titre},#GET{defaut_tri}}{pagination #ENV{nb,10}}>
<tr class="[(#COMPTEUR_BOUCLE|alterner{row_odd,row_even})][(#ID_GIS|=={#ENV{id_lien_ajoute}}|oui)append]">
- <td class='titre principale'>[(#LOGO_GIS|image_reduire{20,20})]<a href="[(#ID_GIS|generer_url_entite{gis})]"
+ <td class='#EDIT{titre} titre principale'>[(#LOGO_GIS|image_reduire{20,20})]<a href="[(#ID_GIS|generer_url_entite{gis})]"
title="<:gis:texte_voir_gis:>">[(#TITRE|sinon{<:ecrire:info_sans_titre:>})]</a></td>
- <td class='pays'>#PAYS</td>
- <td class='ville'>#VILLE</td>
- <td class='id_gis'><a href="[(#ID_GIS|generer_url_entite{gis})]"
+ <td class='#EDIT{pays} pays'>#PAYS</td>
+ <td class='#EDIT{ville} ville'>#VILLE</td>
+ <td class='id_gis'><a href="[(#URL_ECRIRE{gis_edit,id_gis=#ID_GIS})]"
title="<:gis:texte_voir_gis:>">#ID_GIS</a></td>
</tr>
</BOUCLE_liste_gis>
+#SET{defaut_tri,#ARRAY{}}
<B_liste_objets>
-
#ANCRE_PAGINATION
<div class="liste-elements objets_gis">
#SET{total,#GRAND_TOTAL}
var geocoder;]
(function($){
- var champ_lat = $('#champ_#ENV{champ_lat,lat}'),
- champ_lon = $('#champ_#ENV{champ_lon,lon}'),
- champ_zoom = $('#champ_#ENV{champ_zoom,zoom}'),
- champ_adresse = $('#champ_#ENV{champ_adresse,adresse}'),
- champ_code_postal = $('##ENV{champ_code_postal,code_postal}'),
- champ_ville = $('#champ_#ENV{champ_ville,ville}'),
- champ_departement = $('#champ_#ENV{champ_departement,departement}'),
- champ_region = $('#champ_#ENV{champ_region,region}'),
- champ_pays = $('#champ_#ENV{champ_pays,pays}'),
- champ_code_pays = $('#champ_#ENV{champ_code_pays,code_pays}'),
- marker;
-
+ var marker;
+
var maj_inputs = function(map,data,action) {
[(#GET{geocoder}|oui)
if (action != 'geocoding') {
$('#champ_#ENV{champ_zoom,zoom}').val(zoom);
if(action == 'click'){
$('#champ_#ENV{champ_lat,lat}').val(data.lat);
- $('#champ_#ENV{champ_lon,lon}').val(data.lng);
+ $('#champ_#ENV{champ_lon,lon}').val(data.lng);
annuler_geocoder = 1;
form_map.panTo(data);
marker.setLatLng(data);
if (!marker._map)
form_map.addLayer(marker);
}
-
+
[(#GET{geocoder}|oui)
function geocode(query) {
if(! query.error){
$('#champ_#ENV{champ_code_postal,code_postal}').val(query.postcode);
$('#champ_#ENV{champ_ville,ville}').val(query.locality);
$('#champ_#ENV{champ_departement,departement}').val(query.departement);
- $('#champ_#ENV{champ_region,region}').val(query.region);
+ $('#champ_#ENV{champ_region,region}').val(query.region);
$('#champ_#ENV{champ_pays,pays}').val(query.country);
$('#champ_#ENV{champ_code_pays,code_pays}').val(query.country_code);
maj_inputs(form_map,query,'geocoding');
callback(e.target);
});
}
+
form_map.attributionControl.setPrefix('');
marker = new L.Marker(new L.LatLng(#ENV{lat,0}, #ENV{lon,0}), {draggable: true});
"id":"#ENV{id_gis,oui}",
"properties": {
"title":[(#ENV{titre,''}|supprimer_numero|json_encode)],
- "description":[(#ENV{descriptif,''}|json_encode)][,(#LOGO_GIS|oui)
- [(#SET{logo_doc,#LOGO_GIS|image_passe_partout{32,32}|image_recadre{32,32}})]
- #SET{icon_w,#GET{logo_doc}|extraire_attribut{src}|largeur}
- #SET{icon_h,#GET{logo_doc}|extraire_attribut{src}|hauteur}
- ["icon": (#GET{logo_doc}|extraire_attribut{src}|url_absolue|json_encode)],
- "icon_size": \[#GET{icon_w},#GET{icon_h}\],
- "icon_anchor": \[[(#GET{icon_w}|div{2})],[(#GET{icon_h})]\],
- "popup_anchor": \[1,[-(#GET{icon_h}|div{1.2})]\]]
+ "description":[(#ENV{descriptif,''}|json_encode)][
+ (#LOGO_GIS|gis_icon_properties)]
}
}\]
}
<svn_revision>
<text_version>
Origine: file:///home/svn/repository/spip-zone/_plugins_/gis/trunk
-Revision: 86891
-Dernier commit: 2014-12-29 10:00:02 +0100
+Revision: 88709
+Dernier commit: 2015-04-21 12:00:03 +0200
</text_version>
<origine>file:///home/svn/repository/spip-zone/_plugins_/gis/trunk</origine>
-<revision>86891</revision>
-<commit>2014-12-29 10:00:02 +0100 </commit>
+<revision>88709</revision>
+<commit>2015-04-21 12:00:03 +0200 </commit>
</svn_revision>
\ No newline at end of file