Changeset 70461 in spip-zone


Ignore:
Timestamp:
Mar 6, 2013, 10:43:05 AM (6 years ago)
Author:
cedric@…
Message:

eviter une variable globale dont le nom depend de l'id : preferer une globale unique map_cfg et on affecte la config de chaque carte en sous objet

Location:
_plugins_/gis/trunk
Files:
2 edited

Legend:

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

    r70460 r70461  
    7676<script type="text/javascript">/*<!\[CDATA\[*/
    7777var map[(#GET{id})];
    78 var map_cfg_[(#GET{id})] = {
     78if (typeof map_cfg=="undefined") var map_cfg = {};
     79map_cfg["[(#GET{id})]"] = {
    7980"mapid":"map[(#GET{id})]",
    8081"scrollWheelZoom": [(#ENV{zoom_molette,#ENV{zoom_wheel}}|=={non}|?{false,true})],
     
    117118};
    118119if (typeof(callback_map[(#GET{id})]) === "function") {
    119         map_cfg_[(#GET{id})]['callback']=callback_map[(#GET{id})];
     120        map_cfg["[(#GET{id})]"]['callback']=callback_map[(#GET{id})];
    120121}
    121122
     
    123124jQuery.getScript('[(#PRODUIRE{fond=javascript/gis.js,cluster=#ENV{cluster,non}})]',function(){
    124125        jQuery(function(){
    125         gis_init_map(map_cfg_[(#GET{id})]);
     126        gis_init_map(map_cfg["[(#GET{id})]"]);
    126127        });
    127128});
  • _plugins_/gis/trunk/paquet.xml

    r70460 r70461  
    22        prefix="gis"
    33        categorie="divers"
    4         version="4.6.0"
     4        version="4.6.1"
    55        schema="2.0.3"
    66        etat="test"
Note: See TracChangeset for help on using the changeset viewer.