[PLUGINS] ~maj gis v4.26.1-->4.26.10
authorLudovic CHEVALIER <ludovic@beurresarrasin.net>
Tue, 28 Apr 2015 07:19:24 +0000 (09:19 +0200)
committerLudovic CHEVALIER <ludovic@beurresarrasin.net>
Tue, 28 Apr 2015 07:19:24 +0000 (09:19 +0200)
14 files changed:
www/plugins/gis/formulaires/configurer_gis.php
www/plugins/gis/gis_autoriser.php
www/plugins/gis/gis_fonctions.php
www/plugins/gis/gis_options.php
www/plugins/gis/javascript/gis_geocoder.js
www/plugins/gis/lib/leaflet/plugins/KML.js
www/plugins/gis/lib/leaflet/plugins/leaflet-providers.js
www/plugins/gis/modeles/carte_gis_preview.html
www/plugins/gis/paquet.xml
www/plugins/gis/prive/inclure/gis_objet_formulaires.html
www/plugins/gis/prive/objets/liste/gis.html
www/plugins/gis/prive/objets/liste/objets_gis_simple.html
www/plugins/gis/saisies/carte.html
www/plugins/gis/svn.revision

index 40bdc3b..23999bd 100644 (file)
@@ -8,8 +8,12 @@ if (!defined('_ECRIRE_INC_VERSION')) return;
  */
 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');
@@ -22,8 +26,8 @@ function formulaires_configurer_gis_verifier_dist(){
                $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();
        }
        
index 13d4c48..8f67652 100644 (file)
@@ -15,7 +15,7 @@ function gis_autoriser(){};
  * @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);
 }
 
@@ -110,4 +110,4 @@ function autoriser_gis_supprimer_dist($faire,$quoi,$id,$qui,$opts){
        }
        return autoriser('modifier','gis',$id,$qui,$opts);
 }
-?>
\ No newline at end of file
+?>
index 1c22da8..ac757ca 100755 (executable)
@@ -418,8 +418,11 @@ function gis_icon_properties($img=''){
                $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;
 }
index a02cc19..72616c6 100755 (executable)
@@ -9,7 +9,7 @@ $GLOBALS['logo_libelles']['id_gis'] = _T('gis:libelle_logo_gis');
 
 $config = @unserialize($GLOBALS['meta']['gis']);
 
-$GLOBALS['gis_layers'] = array (
+$gis_layers = array (
        'openstreetmap_mapnik' => array(
                'nom' => 'OpenStreetMap',
                'layer' => 'L.tileLayer.provider("OpenStreetMap")'
@@ -31,7 +31,7 @@ $GLOBALS['gis_layers'] = array (
                'layer' => 'L.Google("ROADMAP")'
        ),
        'google_satellite' => array(
-               'nom' => 'Google Satelitte',
+               'nom' => 'Google Satellite',
                'layer' => 'L.Google("SATELLITE")'
        ),
        'google_terrain' => array(
@@ -58,6 +58,10 @@ $GLOBALS['gis_layers'] = 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")'
@@ -160,4 +164,8 @@ $GLOBALS['gis_layers'] = array (
        )
 );
 
-?>
\ 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;
+}
index 822cb7f..d3bf6fc 100644 (file)
@@ -79,9 +79,9 @@ L.Geocoder = L.Class.extend({
                        else {
                                place = response;
                        }
-                       
+
                        var street_components = [];
-                       
+
                        if (place.address.country) {
                                return_location.country = place.address.country;
                        }
@@ -99,8 +99,12 @@ L.Geocoder = L.Class.extend({
                        */
                        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;
index 2a7839d..d521a30 100755 (executable)
@@ -69,6 +69,11 @@ L.Util.extend(L.KML, {
                        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;
        },
 
@@ -87,9 +92,7 @@ L.Util.extend(L.KML, {
                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 = {};
@@ -180,13 +183,28 @@ L.Util.extend(L.KML, {
                        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;
@@ -196,17 +214,13 @@ L.Util.extend(L.KML, {
                }
                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); }
                        }
                }
 
@@ -248,6 +262,17 @@ L.Util.extend(L.KML, {
                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) {
@@ -309,6 +334,54 @@ L.Util.extend(L.KML, {
                        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});
        }
 
 });
@@ -322,12 +395,14 @@ L.KMLIcon = L.Icon.extend({
                        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;
@@ -348,3 +423,34 @@ L.KMLMarker = L.Marker.extend({
        }
 });
 
+// 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;
+       }
+});
+
index 62f650a..5f077fc 100644 (file)
                                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:
                                        '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
                                attribution: 'Map data: &copy; <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: &copy; <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:
                                        '&copy; <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> &mdash; ' +
                                        '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> &mdash; ' +
                                                        '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 &copy; 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
+                                       }
+                               }
+                       }
                }
        };
 
index 2e9ca57..a6b38f8 100755 (executable)
@@ -1,6 +1,6 @@
 <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
index e3da2d5..8c78431 100644 (file)
@@ -1,7 +1,7 @@
 <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.*]"
index dc6ab9b..32332bb 100644 (file)
@@ -1,4 +1,5 @@
 <div class="ajax">
+#SET{gis_defaut,''}
 <BOUCLE_test(GIS){objet}{id_objet}{0,1}> </BOUCLE_test>
 #SET{gis_defaut,nouveau}
 #SET{gis_defaut,glop}
index a4f6e6c..202f829 100644 (file)
        <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>
index 688e540..d1e0a24 100644 (file)
@@ -1,5 +1,5 @@
+#SET{defaut_tri,#ARRAY{}}
 <B_liste_objets>
-
 #ANCRE_PAGINATION
 <div class="liste-elements objets_gis">
 #SET{total,#GRAND_TOTAL}
index a58fbdf..9936f74 100644 (file)
@@ -42,18 +42,8 @@ var form_map,
 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') {
@@ -65,7 +55,7 @@ var geocoder;]
                $('#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);
@@ -86,7 +76,7 @@ var geocoder;]
                if (!marker._map)
                        form_map.addLayer(marker);
        }
-
+       
        [(#GET{geocoder}|oui)
        function geocode(query) {
                if(! query.error){
@@ -94,7 +84,7 @@ var geocoder;]
                        $('#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');
@@ -117,6 +107,7 @@ var geocoder;]
                                callback(e.target);
                        });
                }
+               
                form_map.attributionControl.setPrefix('');
                
                marker = new L.Marker(new L.LatLng(#ENV{lat,0}, #ENV{lon,0}), {draggable: true});
@@ -172,14 +163,8 @@ var geocoder;]
                                        "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)]
                                        }
                                }\]
                }
index ec1599a..af8f181 100644 (file)
@@ -1,10 +1,10 @@
 <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