Changeset 96681 in spip-zone


Ignore:
Timestamp:
Apr 19, 2016, 3:12:38 PM (3 years ago)
Author:
kent1@…
Message:

Ici aussi permettre de ne pas avoir de fond de carte par défaut, on ne sait jamais

Location:
_plugins_
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/gis/trunk/modeles/carte_gis_preview.html

    r96577 r96681  
    1414                map_preview.attributionControl.setPrefix('');
    1515
    16                 var base_layer = [new (#EVAL{$GLOBALS\['gis_layers'\]}|table_valeur{[(#ENV{layer_defaut,[(#REM|gis_layer_defaut)]})]/layer})];
    17                 map_preview.addLayer(base_layer);
     16                var base_layer = [(#ENV{layer_defaut}|=={none}|?{"'none'",[new (#EVAL{$GLOBALS\['gis_layers'\]}|table_valeur{[(#ENV{layer_defaut,[(#REM|gis_layer_defaut)]})]/layer})]})];
     17                if(base_layer != 'none'){
     18                        map_preview.addLayer(base_layer);
     19                }
    1820               
    1921                map_preview.setView(new L.LatLng([(#LAT)],[(#LON)]),[(#ZOOM|sinon{#CONFIG{gis/zoom,0}})]);
  • _plugins_/gis_geometries/modeles/carte_gis_preview.html

    r96587 r96681  
    1111                        map_preview_container = 'map_preview#ENV{id_map}',
    1212                        marker,
    13                         base_layer = [new (#EVAL{$GLOBALS\['gis_layers'\]}|table_valeur{[(#ENV{layer_defaut,[(#REM|gis_layer_defaut)]})]/layer})];
     13                        base_layer = [(#ENV{layer_defaut}|=={none}|?{"'none'",[new (#EVAL{$GLOBALS\['gis_layers'\]}|table_valeur{[(#ENV{layer_defaut,[(#REM|gis_layer_defaut)]})]/layer})]})];
    1414               
    1515                map_preview = new L.Map(map_preview_container);
    1616                map_preview.attributionControl.setPrefix('');
    17                 map_preview.addLayer(base_layer);
     17                if(base_layer != 'none'){
     18                        map_preview.addLayer(base_layer);
     19                }
    1820               
    1921                map_preview.setView(new L.LatLng([(#GET{lat,#CONFIG{gis/lat,0}})],[(#GET{lon,#CONFIG{gis/lon,0}})]),[(#ZOOM|sinon{#CONFIG{gis/zoom,0}})]);
Note: See TracChangeset for help on using the changeset viewer.