renvoi du code javascript pour l'ajout de nouveaux points sur la carte google map dont le centre a changé
183756
public function getJsGoogleMapNewCenter($params = array())
    {
        //$googleMap = new googleMap(array('googleMapKey'=>$this->googleMapKey));
        $retour="";
        //$retour=  $googleMap->getJsFunctions();
        $rayon = 250;
        if (isset($this->variablesGet['rayon']) && $this->variablesGet['rayon']!='') {
            $rayon = $this->variablesGet['rayon'];
        }


        $arrayConfigCoordonnees = $this->getArrayGoogleMapConfigCoordonneesFromCenter(array('urlRedirectedToParent'=>true,'longitude'=>$this->variablesGet['longitudeCenter'],'latitude'=>$this->variablesGet['latitudeCenter'],'rayon'=>$rayon));


        if (isset($this->variablesGet['noRefresh']) && $this->variablesGet['noRefresh']=='1') {
        } else {
            $retour .="map.clearOverlays();";
        }



        if (isset($this->variablesGet['noRefresh']) && $this->variablesGet['noRefresh']=='1') {
        // pas besoin de replace le markeur central
        } else {
            // on replace le markeur indiquant l'adresse courante
            if (isset($this->variablesGet['latitudeHome']) && isset($this->variablesGet['longitudeHome']) && $this->variablesGet['latitudeHome']!='' && $this->variablesGet['longitudeHome']!='') {
                $retour.="

                var iconHome = new GIcon();

                iconHome.image = \"".$this->getUrlImage()."placeMarker.png\";
                //iconHome.shadow = \"http://labs.google.com/ridefinder/images/mm_20_shadow.png\";
                iconHome.iconSize = new GSize(19, 32);
                iconHome.shadowSize = new GSize(22, 20);
                iconHome.iconAnchor = new GPoint(5, 26);
                iconHome.infoWindowAnchor = new GPoint(5, 1);

                markerHome = new GMarker(new GLatLng(".$this->variablesGet['latitudeHome'].",".$this->variablesGet['longitudeHome']."),{icon:iconHome});
                map.addOverlay(markerHome);
                ";
            }
        }

        $retour.="
                var icon = new GIcon();
                //icon.image = image;


                icon.image = '".$this->getUrlImage()."pointGM.png';
                icon.shadow = '';
                icon.iconSize = new GSize(9, 9);
                icon.shadowSize = new GSize(22, 20);
                icon.iconAnchor = new GPoint(0, 0); // 2,24
                icon.infoWindowAnchor = new GPoint(5, 1);
                var iconMarker = new GIcon(icon);"
                ;
        foreach ($arrayConfigCoordonnees['arrayConfigCoordonnees'] as $indice => $values) {
            $retour.="
                    point$indice = new GLatLng(".$values['latitude'].",".$values['longitude'].");
                    marker$indice = new GMarker(point$indice,iconMarker);
                    overlay$indice = map.addOverlay(marker$indice);";
            $retour.="                  var eLabel$indice = new ELabel(point$indice,\"".str_replace("\"", "&quot;", $values['label'])."\",\"styleLabelGoogleMap\");
                    eLabel$indice.pixelOffset = new GSize(20,-10);
                    map.addOverlay(eLabel$indice);
                    eLabel$indice.hide();";
            $retour.="function onClickFunction$indice(overlay, point){currentMarker = marker$indice; currentLabel=eLabel$indice; ".$values['jsCodeOnClickMarker']."}";
                    $retour.="GEvent.addListener(marker$indice, 'click', onClickFunction$indice);";


            if (isset($values['jsCodeOnMouseOverMarker'])) {
                $retour.="function onMouseOverFunction$indice(overlay,point){currentMarker = marker$indice; currentLabel = eLabel$indice; ".$values['jsCodeOnMouseOverMarker']."}";
                $retour.="GEvent.addListener(marker$indice,'mouseover',onMouseOverFunction$indice);";
            }

            if (isset($values['jsCodeOnMouseOutMarker'])) {
                $retour.="function onMouseOutFunction$indice(overlay,point){currentMarker = marker$indice; currentLabel = eLabel$indice; ".$values['jsCodeOnMouseOutMarker']."}";
                $retour.="GEvent.addListener(marker$indice,'mouseout',onMouseOutFunction$indice);";
            }
        }

        return $retour;
    }
216644
function pointToQuery(url, requestFormatter, responseFormatter) {
	  return function (inputSource) {
	    return function outputSource(start, outputSink) {
	      if (start !== 0) return;
	      inputSource(0, function (t, d) {
	        if (t === 1) {
	          var queryUrl = requestFormatter(url, { x: d.latlng.lng, y: d.latlng.lat });
	          query(queryUrl).then(function (res) {
	            var output = {
	              queryResult: responseFormatter(res),
	              latlng: d.latlng
	            };
	            outputSink(1, output);
	          });
	        } else {
	          outputSink(t, d);
	        }
	      });
	    };
	  };
	}
1181883
function callWebService( name, args, url ) {
    return new Promise(
        function( resolve, reject ) {
            svc( name, args, url ).then(
                resolve,
                function( err ) {
                    if ( typeof err === 'object' && err.id === exports.BAD_ROLE ) {
                        // Echec de connexion, on retente de se connecter avant d'abandonner.
                        login().then(
                            function() {
                                svc( name, args, url ).then( resolve, reject );
                            },
                            reject
                        );
                    } else {
                        reject( err );
                    }
                }
            );
        }
    );
}
1086826
function genPoints (inArr, ref, ref$1) {
  var minX = ref.minX;
  var minY = ref.minY;
  var maxX = ref.maxX;
  var maxY = ref.maxY;
  var max = ref$1.max;
  var min = ref$1.min;

  var arr = inArr.map(function (item) { return (typeof item === 'number' ? item : item.value); });
  var minValue = Math.min.apply(Math, arr.concat( [min] )) - 0.001;
  var gridX = (maxX - minX) / (arr.length - 1);
  var gridY = (maxY - minY) / (Math.max.apply(Math, arr.concat( [max] )) + 0.001 - minValue);

  return arr.map(function (value, index) {
    var title = typeof inArr[index] === 'number' ? inArr[index] : inArr[index].title;
    return {
      x: index * gridX + minX,
      y:
        maxY -
        (value - minValue) * gridY +
        +(index === arr.length - 1) * 0.00001 -
        +(index === 0) * 0.00001,
      v: title
    }
  })
}
140860
function (marker, location, infowindow, storeStart, page) {
			this.writeDebug('createInfowindow',arguments);
			var _this = this;
			// Define the location data
			var locations = this._defineLocationData(marker, storeStart, page);

			// Set up the infowindow template with the location data
			var formattedAddress = infowindowTemplate(locations);

			// Opens the infowindow when list item is clicked
			if (location === 'left') {
				infowindow.setContent(formattedAddress);
				infowindow.open(marker.get('map'), marker);
			}
			// Opens the infowindow when the marker is clicked
			else {
				google.maps.event.addListener(marker, 'click', function () {
					infowindow.setContent(formattedAddress);
					infowindow.open(marker.get('map'), marker);
					// Focus on the list
					var markerId = marker.get('id');
					var $selectedLocation = $('.' + _this.settings.locationList + ' li[data-markerid=' + markerId + ']');

					if ($selectedLocation.length > 0) {
						// Marker click callback
						if (_this.settings.callbackMarkerClick) {
							_this.settings.callbackMarkerClick.call(this, marker, markerId, $selectedLocation, locationset[markerId]);
						}

						$('.' + _this.settings.locationList + ' li').removeClass('list-focus');
						$selectedLocation.addClass('list-focus');

						// Scroll list to selected marker
						var $container = $('.' + _this.settings.locationList);
						$container.animate({
							scrollTop: $selectedLocation.offset().top - $container.offset().top + $container.scrollTop()
						});
					}

					// Custom selected marker override
					if (_this.settings.selectedMarkerImg !== null) {
						_this.changeSelectedMarker(marker);
					}
				});
			}
		}
1172224
function (countries, preferred, preferredDelim) {
        var preferredShortCodes = preferred.split(',').reverse();
        var preferredMap = {};
        var foundPreferred = false;

        var updatedCountries = countries.filter(function (c) {
            if (preferredShortCodes.indexOf(c[1]) !== -1) {
                preferredMap[c[1]] = c;
                foundPreferred = true;
                return false;
            }
            return true;
        });

        if (foundPreferred && preferredDelim) {
            updatedCountries.unshift([preferredDelim, "", "", {}, true]);
        }

        // now prepend the preferred countries
        for (var i=0; i<preferredShortCodes.length; i++) {
            var code = preferredShortCodes[i];
            updatedCountries.unshift(preferredMap[code]);
        }

        return updatedCountries;
    }
271373
public function getGoogleMapIframe($params = array())
    {
        $html='<link href="css/default.css" rel="stylesheet" type="text/css" />
    ';

        if (isset($this->variablesGet['longitude']) && $this->variablesGet['longitude']!='' && isset($this->variablesGet['latitude']) && $this->variablesGet['latitude']!='') {
            $ajax = new ajaxObject();
            $html.=$ajax->getAjaxFunctions();

            $longitude = $this->variablesGet['longitude'];
            $latitude = $this->variablesGet['latitude'];

            $listeCoords = array();

            // si archiIdAdresse est précisé , on remplace les coordonnées par celle de l'adresse ( car celle envoyée sont celle de la premiere du groupe d'adresse)
            $isCoordonneesAdresseCouranteValide = true;
            $isCoordonneesGroupeAdresseOK = false;

            if (isset($this->variablesGet['archiIdAdresse']) && $this->variablesGet['archiIdAdresse']!='' && isset($this->variablesGet['archiIdEvenementGroupeAdresse']) && $this->variablesGet['archiIdEvenementGroupeAdresse']!='') {
            // s'il existe des coordonnées pour le groupe d'adresse dans la table _adresseEvenement, on prend celles ci
                $reqCoordonneesGroupeAdresse = "SELECT longitudeGroupeAdresse,latitudeGroupeAdresse FROM _adresseEvenement WHERE idAdresse='".$this->variablesGet['archiIdAdresse']."' AND idEvenement='".$this->variablesGet['archiIdEvenementGroupeAdresse']."' AND longitudeGroupeAdresse<>'0' AND latitudeGroupeAdresse<>'0'";
                $resCoordonneesGroupeAdresse = $this->connexionBdd->requete($reqCoordonneesGroupeAdresse);
                if (mysql_num_rows($resCoordonneesGroupeAdresse)>0) {
                    $fetchCoordonneesGroupeAdresse = mysql_fetch_assoc($resCoordonneesGroupeAdresse);
                    $longitude = $fetchCoordonneesGroupeAdresse['longitudeGroupeAdresse'];
                    $latitude = $fetchCoordonneesGroupeAdresse['latitudeGroupeAdresse'];
                    $isCoordonneesGroupeAdresseOK = true;
                }
            }

            if (isset($this->variablesGet['archiIdAdresse']) && $this->variablesGet['archiIdAdresse']!='' && $this->variablesGet['archiIdAdresse']!='0' && !$isCoordonneesGroupeAdresseOK) {
                $reqCoordonnees = "
                    SELECT ha1.longitude as longitude, ha1.latitude as latitude
                    FROM historiqueAdresse ha2, historiqueAdresse ha1
                    WHERE ha2.idAdresse = ha1.idAdresse
                    AND ha1.idAdresse = '".$this->variablesGet['archiIdAdresse']."'
                    GROUP BY ha1.idAdresse, ha1.idHistoriqueAdresse
                    HAVING ha1.idHistoriqueAdresse = max(ha2.idHistoriqueAdresse)
                ";

                $resCoordonnees = $this->connexionBdd->requete($reqCoordonnees);

                if (mysql_num_rows($resCoordonnees)==1) {
                    $fetchCoordonnees = mysql_fetch_assoc($resCoordonnees);
                    if ($fetchCoordonnees['longitude']!='' && $fetchCoordonnees['latitude']!='' && $fetchCoordonnees['longitude']!='0' && $fetchCoordonnees['latitude']!='0') {
                        $longitude = $fetchCoordonnees['longitude'];
                        $latitude = $fetchCoordonnees['latitude'];
                    } else {
                        $isCoordonneesAdresseCouranteValide = false;
                    }
                }
            }

            $affichageCoordonneesVille = false;
            if ($longitude<0 || $latitude<0 || $longitude==0 || $latitude==0 || !$isCoordonneesAdresseCouranteValide) {
            // on detection une longitude ou latitude negative : il doit y avoir eu une erreur de detection des parametres
                // on va centrer la carte sur la ville

                if (isset($this->variablesGet['archiIdAdresse']) && $this->variablesGet['archiIdAdresse']!='' && $this->variablesGet['archiIdAdresse']!='0') {
                // recuperation de l'idville de l'adresse courante
                    $idVille = $this->getIdVilleFrom($this->variablesGet['archiIdAdresse'], 'idAdresse');
                    // coordonnees de la ville
                    $reqCoordonneesVille = "SELECT longitude,latitude,nom FROM ville WHERE idVille = '".$idVille."'";
                    $resCoordonneesVille = $this->connexionBdd->requete($reqCoordonneesVille);
                    $fetchCoordonneesVille = mysql_fetch_assoc($resCoordonneesVille);
                    $longitude = $fetchCoordonneesVille['longitude'];
                    $latitude = $fetchCoordonneesVille['latitude'];
                    $affichageCoordonneesVille = true;
                }
            }

            // rayon en metres
            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']=='popupDetailAdresse') {
             // dans le cas de l'affichage de la popup sur le detail de l'adresse on prend un rayon plus grand, donc plus d'adresses affichées
                $rayon = 200;
            } else {
                $rayon = 200;
            }

            $arrayGoogleMapCoord = $this->getArrayGoogleMapConfigCoordonneesFromCenter(array('longitude'=>$longitude,'latitude'=>$latitude,'rayon'=>$rayon));

            $listeCoords = $arrayGoogleMapCoord['arrayConfigCoordonnees'];
            // verification des droits
            $isAuthorizedToDrag = false;
            $widthGoogleMapModePopup = 650;
            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']=='popupDetailAdresse') {
                if (isset($this->variablesGet['archiIdAdresse']) && $this->variablesGet['archiIdAdresse']!='' && isset($this->variablesGet['archiIdEvenementGroupeAdresse']) && $this->variablesGet['archiIdEvenementGroupeAdresse']!='') {
                    $idAdresseCentree = $this->variablesGet['archiIdAdresse'];
                    $idEvenementGroupeAdresseCentre = $this->variablesGet['archiIdEvenementGroupeAdresse'];


                    $utilisateur = new archiUtilisateur();
                    $authentification = new archiAuthentification();

                    // verification des droits
                    if ($utilisateur->isAuthorized('googlemap_change_coordonnees', $authentification->getIdUtilisateur())) {
                        if ($utilisateur->getIdProfil($authentification->getIdUtilisateur())==4 || ($utilisateur->getIdProfil($authentification->getIdUtilisateur())==3
                            && $utilisateur->isModerateurFromVille($authentification->getIdUtilisateur(), $idAdresseCentree, 'idAdresse'))) {
                            $isAuthorizedToDrag = true;
                            $widthGoogleMapModePopup = 650;
                        }
                    }
                }
            }

            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']=='popupDetailAdresse') {
            // affichage pour la popup sur le detail d'une adresse
                if ($affichageCoordonneesVille) {
                    $gm = new googleMap(array('googleMapKey'=>$this->googleMapKey,'width'=>$widthGoogleMapModePopup,'height'=>500,'zoom'=>11,'noDisplayZoomSelectionSquare'=>true,'noDisplayZoomSlider'=>false,'zoomType'=>'mini','noDisplayEchelle'=>true,'noDisplayMapTypeButtons'=>false,'centerLong'=>$longitude,'centerLat'=>$latitude,'mapType'=>'G_SATELLITE_MAP'));
                } else {
                    $gm = new googleMap(array('googleMapKey'=>$this->googleMapKey,'width'=>$widthGoogleMapModePopup,'height'=>500,'zoom'=>17,'noDisplayZoomSelectionSquare'=>true,'noDisplayZoomSlider'=>false,'zoomType'=>'mini','noDisplayEchelle'=>true,'noDisplayMapTypeButtons'=>false,'centerLong'=>$longitude,'centerLat'=>$latitude,'mapType'=>'G_SATELLITE_MAP'));
                }
            } else {
                if ($affichageCoordonneesVille) {
                    $gm = new googleMap(array('googleMapKey'=>$this->googleMapKey,'width'=>275,'height'=>275,'zoom'=>10,'noDisplayZoomSelectionSquare'=>true,'noDisplayZoomSlider'=>false,'zoomType'=>'mini','noDisplayEchelle'=>true,'noDisplayMapTypeButtons'=>true,'centerLong'=>$longitude,'centerLat'=>$latitude,'mapType'=>'G_SATELLITE_MAP'));
                } else {
                    // affichage par defaut , s'affichage en haut de la page detail d'une adresse , a gauche de l'encars
                    $gm = new googleMap(array('googleMapKey'=>$this->googleMapKey,'width'=>275,'height'=>275,'zoom'=>16,'noDisplayZoomSelectionSquare'=>true,'noDisplayZoomSlider'=>false,'zoomType'=>'mini','noDisplayEchelle'=>true,'noDisplayMapTypeButtons'=>true,'centerLong'=>$longitude,'centerLat'=>$latitude,'mapType'=>'G_SATELLITE_MAP'));//,'divStyle'=>'margin-top:-17px;'
                }
            }
            $html.=$gm->getJsFunctions();
            //$html.="<script  >".$gm->setFunctionAddPointsCallableFromChild()."</script>";
            $html.=$gm->getMap(array('listeCoordonnees'=>$listeCoords,'urlImageIcon'=>$this->getUrlImage()."pointGM.png",'pathImageIcon'=>$this->getCheminPhysique()."images/pointGM.png"));

            // on ajoute le markeur central a la main
            $html.="<script  >
                var iconHome = new GIcon();
                iconHome.image = \"".$this->getUrlImage()."placeMarker.png\";
                //iconHome.shadow = \"https://labs.google.com/ridefinder/images/mm_20_shadow.png\";
                iconHome.iconSize = new GSize(19, 32);
                iconHome.shadowSize = new GSize(22, 20);
                iconHome.iconAnchor = new GPoint(5, 26);
                iconHome.infoWindowAnchor = new GPoint(5, 1);

                //var iconMarkerHome = new GIcon(iconHome);
                ";

            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']=='popupDetailAdresse' && $isAuthorizedToDrag) {
                $html.="markerHome = new GMarker(new GLatLng(".$latitude.",".$longitude."),{icon:iconHome, draggable: true});";
            } else {
                $html.="markerHome = new GMarker(new GLatLng(".$latitude.",".$longitude."),{icon:iconHome});";
            }

            $html.="map.addOverlay(markerHome);";

            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']=='popupDetailAdresse' && $isAuthorizedToDrag) {
                $html.="markerHome.enableDragging();";
            }

            if (isset($this->variablesGet['modeAffichage']) && $this->variablesGet['modeAffichage']=='popupDetailAdresse' && $isAuthorizedToDrag) {
                $html.="GEvent.addListener(markerHome,'drag',function(){parent.window.document.getElementById('latitudeUser').value=markerHome.getPoint().lat();parent.window.document.getElementById('longitudeUser').value=markerHome.getPoint().lng();parent.window.document.getElementById('validationCoordonnees').style.display='';});
                ";

                $html.="GEvent.addListener(
                            map,
                            'dragend',
                            function(){appelAjaxReturnJs('".html_entity_decode($this->creerUrl('', 'majGoogleMapNewCenter', array('noRefresh'=>1,'noHTMLHeaderFooter'=>1,'noHeaderNoFooter'=>1,'latitudeHome'=>$latitude,'longitudeHome'=>$longitude)))."&longitudeCenter='+map.getCenter().lng()+'&latitudeCenter='+map.getCenter().lat(),'divListeAdressesAjax')}
                            );";
            } else {
                    $html.="GEvent.addListener(
                            map,
                            'dragend',
                            function(){appelAjaxReturnJs('".html_entity_decode($this->creerUrl('', 'majGoogleMapNewCenter', array('noHTMLHeaderFooter'=>1,'noHeaderNoFooter'=>1,'latitudeHome'=>$latitude,'longitudeHome'=>$longitude)))."&longitudeCenter='+map.getCenter().lng()+'&latitudeCenter='+map.getCenter().lat(),'divListeAdressesAjax')}
                            );";
                    //$html.="GEvent.addListener(map,'dragend',function(){document.getElementById('iFrameMajCenter').src='".$this->creerUrl('','majGoogleMapNewCenter',array('noHeaderNoFooter'=>1,'latitudeHome'=>$latitude,'longitudeHome'=>$longitude))."&longitudeCenter='+map.getCenter().lng()+'&latitudeCenter='+map.getCenter().lat();});";
            }

            //$html.=$gm->setFunctionAddPointsCallableFromChild(array());

            $html.="</script>";
            //$html.="<div id='jsMiseAJourCenter' ><iframe id='iFrameMajCenter' src=''></iframe></div>";//style='position:absolute;left:0px;top:0px;'
        }

        return $html;

    }
1153558
function (position) {
    var lat = position.coords.latitude;
    var lng = position.coords.longitude;
    geo_codeLatLng(lat, lng);
}
228015
function init() {
  var myOptions = {
    zoom: 15,
    center: new google.maps.LatLng(61.18, -149.86),
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    draggableCursor: 'default'
  }
  map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  svc = new gmaps.ags.GeometryService('http://sampleserver1.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer');
  
  google.maps.event.addListener(map, 'click', function(evt) {
    projectTo(evt.latLng);
  });
  
  iw = new google.maps.InfoWindow({
    maxWidth: 200,
    content: 'Click map to project the clicked point to Alaska Albers Feet Projection',
    position: map.getCenter()
  });
  iw.open(map);
}
353643
function (position) {
        var center = new OpenLayers.LonLat(
            position.coords.longitude,
            position.coords.latitude
        ).transform(
            new OpenLayers.Projection("EPSG:4326"),
            this.map.getProjectionObject()
        );
        if (this.bind) {
            this.map.setCenter(center);
        }
        this.events.triggerEvent("locationupdated", {
            position: position,
            point: new OpenLayers.Geometry.Point(
                center.lon, center.lat
            )
        });
    }
595861
function ( )
			{
				this.addCategory ( 
					'01',
					{ 'en' : 'Airport', 'fr' : 'Aéroport', 'nl' : 'Luchthaven', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0001"></div>'}) );
				this.addCategory ( 
					'02',
					{ 'en' : 'Ascent', 'fr' : 'Montée', 'nl' : 'Helling', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0002"></div>'}) );
				this.addCategory ( 
					'03',
					{ 'en' : 'ATM', 'fr' : 'Distributeur de billets', 'nl' : 'Giromaat', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0003"></div>'}) );
				this.addCategory ( 
					'04', 
					{ 'en' : 'Attention', 'fr' : 'Attention requise', 'nl' : 'Pas op', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0004"></div>'}) );
				this.addCategory ( 
					'05', 
					{ 'en' : 'Bikes admitted', 'fr' : 'Vélos admis', 'nl' : 'Fiets welkom', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0005"></div>'}) );
				this.addCategory ( 
					'06', 
					{ 'en' : 'Bus', 'fr' : 'Autobus', 'nl' : 'Bus', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0006"></div>'}) );
				this.addCategory ( 
					'07', 
					{ 'en' : 'Picture', 'fr' : 'Photo', 'nl' : 'Foto', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0007"></div>'}) );
				this.addCategory ( 
					'08', 
					{ 'en' : 'Camping', 'fr' : 'Camping', 'nl' : 'Camping', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0008"></div>'}) );
				this.addCategory ( 
					'09', 
					{ 'en' : 'Ferry', 'fr' : 'Ferry', 'nl' : 'Veerboot', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0009"></div>'}) );
				this.addCategory ( 
					'10', 
					{ 'en' : 'Youth hostel', 'fr' : 'Auberge de jeunesse', 'nl' : 'Jeugdherberg', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0010"></div>'}) );
				this.addCategory ( 
					'11', 
					{ 'en' : 'Information point', 'fr' : 'Point d\'information', 'nl' : 'Informatiepunt', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0011"></div>'}) );
				this.addCategory ( 
					'12', 
					{ 'en' : 'National park', 'fr' : 'Parc national', 'nl' : 'Nationaal park', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0012"></div>'}) );
				this.addCategory ( 
					'13', 
					{ 'en' : 'Bike not authorized', 'fr' : 'Vélos mal vus', 'nl' : 'Fiets niet welkom', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0013"></div>'}) );
				this.addCategory ( 
					'14', 
					{ 'en' : 'Regional park', 'fr' : 'Parc régional', 'nl' : 'Gewestelijk natuurpark', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0014"></div>'}) );
				this.addCategory ( 
					'15', 
					{ 'en' : 'Repair', 'fr' : 'Entretien vélo', 'nl' : 'Rijwielhersteller', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0015"></div>'}) );
				this.addCategory ( 
					'16', 
					{ 'en' : 'Shop', 'fr' : 'Magasin', 'nl' : 'Winkel', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0016"></div>'}) );
				this.addCategory ( 
					'17', 
					{ 'en' : 'Help', 'fr' : 'Aide', 'nl' : 'Hulp', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0017"></div>'}) );
				this.addCategory ( 
					'18', 
					{ 'en' : 'Stop', 'fr' : 'Stop', 'nl' : 'Stop', },
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0018"></div>'}) );
				this.addCategory ( 
					'19', 
					{ 'en' : 'Table', 'fr' : 'Table', 'nl' : 'Tafel', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0019"></div>'}) );
				this.addCategory ( 
					'20', 
					{ 'en' : 'Toilets', 'fr' : 'Toilettes', 'nl' :'Toilet', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0020"></div>'}) );
				this.addCategory ( 
					'21', 
					{ 'en' : 'Railway station', 'fr' : 'Gare', 'nl' : 'Treinstation', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0021"></div>'}) );
				this.addCategory ( 
					'22', 
					{ 'en' : 'Tunnel', 'fr' : 'Tunnel', 'nl' : 'Tunnel', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0022"></div>'}) );
				this.addCategory ( 
					'23', 
					{ 'en' : 'Water point', 'fr' : 'Point d\'eau', 'nl' : 'Waterpunt', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0023"></div>'}) );
				this.addCategory ( 
					'24', 
					{ 'en' : 'Bed and breakfast', 'fr' : 'Chambre d\'hotes', 'nl' : 'Bed and Breakfast', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0024"></div>'}) );
				this.addCategory ( 
					'25', 
					{ 'en' : 'Coffe shop', 'fr' : 'Cafetaria ', 'nl' : 'Cafetaria ', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0025"></div>'}) );
				this.addCategory ( 
					'26', 
					{ 'en' : 'Restaurant', 'fr' : 'Restaurant', 'nl' : 'Restaurant', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0026"></div>'}) );
				this.addCategory ( 
					'27', 
					{ 'en' : 'Hostel', 'fr' : 'Hôtel', 'nl' : 'Hotel', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0027"></div>'}) );
				this.addCategory ( 
					'28', 
					{ 'en' : 'Start', 'fr' : 'Départ', 'nl' : 'Start', }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0028"></div>'}) );
				this.addCategory ( 
					'29', 
					{ 'en' : 'Enter ferry', 'fr' : 'Entrée du ferry' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0029"></div>'}) );
				this.addCategory ( 
					'30', 
					{ 'en' : 'Exit ferry', 'fr' : 'Sortie du ferry' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0030"></div>'}) );
				this.addCategory ( 
					'31', 
					{ 'en' : 'Continue', 'fr' : 'Continuer' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0031"></div>'}) );
				this.addCategory ( 
					'32', 
					{ 'en' : 'Turn slight left', 'fr' : 'Tourner légèrement à gauche' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0032"></div>'}) );
				this.addCategory ( 
					'33', 
					{ 'en' : 'Turn left', 'fr' : 'Tourner à gauche' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0033"></div>'}) );
				this.addCategory ( 
					'34', 
					{ 'en' : 'Turn sharp left', 'fr' : 'Tourner fort à gauche' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0034"></div>'}) );
				this.addCategory ( 
					'35', 
					{ 'en' : 'Turn slight right', 'fr' : 'Tourner légèrement à droite' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0035"></div>'}) );
				this.addCategory ( 
					'36', 
					{ 'en' : 'Turn right', 'fr' : 'Tourner à droite' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0036"></div>'}) );
				this.addCategory ( 
					'37', 
					{ 'en' : 'Turn sharp right', 'fr' : 'Tourner fort à droite' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0037"></div>'}) );
				this.addCategory ( 
					'38', 
					{ 'en' : 'Bike node', 'fr' : 'Point noeud vélo' }, 
					L.divIcon ( { iconSize: [40, 40], iconAnchor: [20, 20], popupAnchor: [0, -20], html : '<div class="Pin-Icon Pin-Category-0038"></div>'}) );
			}
738567
function doSearch() {
    var value = document.getElementById('search').value;
    marks = [];
    marksIndex = 0;
    for (var key in markers) {
        if ( (~(key.toLowerCase()).indexOf(value.toLowerCase())) && (mb.contains(markers[key].getLatLng()))) {
            marks.push(markers[key]);
        }
        if (markers[key].icon === value) {
            marks.push(markers[key]);
        }
    }
    moveToMarks();
    if (marks.length === 0) {
        // If no markers found let's try a geolookup...
        var protocol = location.protocol;
        if (protocol == "file:") { protocol = "https:"; }
        var searchUrl = protocol + "//nominatim.openstreetmap.org/search?format=json&limit=1&q=";

        fetch(searchUrl + value) // Call the fetch function passing the url of the API as a parameter
        .then(function(resp) { return resp.json(); })
        .then(function(data) {
            if (data.length > 0) {
                var bb = data[0].boundingbox;
                map.fitBounds([ [bb[0],bb[2]], [bb[1],bb[3]] ]);
                map.panTo([data[0].lat, data[0].lon]);
            }
            else {
                document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Not Found</font>";
            }
        })
        .catch(function(err) {
            if (err.toString() === "TypeError: Failed to fetch") {
                document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Not Found</font>";
            }
        });
    }
    else {
        if (lockit) {
            document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Found "+marks.length+" results within bounds.</font>";
        } else {
            document.getElementById('searchResult').innerHTML = "&nbsp;<font color='#ff0'>Found "+marks.length+" results.</font>";
        }
    }
}
774442
function isUTF8($str)
    {
         // astuce pour entrer dans un test booléen ^^
         // (si c'est un tableau... ce qui est forcement vrai)
        if (is_array($str)) {
            $str = implode('', $str);
            // retourne FALSE si aucun caractere n'appartient au jeu utf8
            return !((ord($str[0]) != 239) && (ord($str[1]) != 187) && (ord($str[2]) != 191));
        } else {
            // retourne TRUE
            // si la chaine decoder et encoder est egale a elle meme
            return (utf8_encode(utf8_decode($str)) == $str);
        }    
    }
868625
function doTidyUp(l) {
    var d = parseInt(Date.now()/1000);
    for (var m in markers) {
        if ((l && (l == markers[m].lay)) || typeof markers[m].ts != "undefined") {
            if ((l && (l == markers[m].lay)) || (markers[m].hasOwnProperty("ts") && (Number(markers[m].ts) < d) && (markers[m].lay !== "_drawing"))) {
                //console.log("STALE :",m);
                layers[markers[m].lay].removeLayer(markers[m]);
                if (typeof polygons[m] != "undefined") {
                    layers[markers[m].lay].removeLayer(polygons[m]);
                    delete polygons[m];
                }
                if (typeof polygons[m+"_"] != "undefined") {
                    layers[polygons[m+"_"].lay].removeLayer(polygons[m+"_"]);
                    delete polygons[m+"_"];
                }
                delete markers[m];
            }
        }
    }
    if (l) {
        if (layers[l]) { map.removeLayer(layers[l]); layercontrol.removeLayer(layers[l]); delete layers[l]; }
        if (overlays[l]) { map.removeLayer(overlays[l]); layercontrol.removeLayer(overlays[l]); delete overlays[l]; }
    }
}
873150
function map($view_content, $view_params = array())
	{
		// trova tutte le regole racchiuse tra doppie graffe
		$rules = ViewUtility::find_rules($view_content, '{{', '}}');

        foreach ($rules as $rule) 
        {
        	// estrapola la parte di codice racchiusa
            $rule_code = str_replace('{{', '', $rule);
            $rule_code = str_replace('}}', '', $rule_code);
            $rule_code = trim($rule_code);
			$rule_code = trim($rule_code, ';');

			// memorizza qui l'esito dell'elaborazione
			$rule_code_value = null;

			// se è una sola parola
			// presumibilmente è una variabile
			// in tal caso, esegui la stampa del valore
			if(strpos($rule_code, '$') === 0)
			{
				// cerca tra i parametri della vista
				if ($rule_code_value == null)
				{
					$rule_code_variable = ltrim($rule_code, '$');
					foreach ($view_params as $param_key => $param_value) 
					{
						if($param_key == $rule_code_variable)
						{
							$rule_code_value = $param_value;
							break;
						}
					}
				}
			}
			else
			{
				// si tratta di una funzione presumibilmente
				$rule_code_value = eval("$rule_code;");
				if($rule_code_value == null)
				{
					// it is a void function
					$rule_code_value = eval("return $rule_code;");
				}
			}

            $view_content = str_replace($rule, $rule_code_value, $view_content);
        }
        return $view_content;

	}
1029810
public function printRequireJS(AbstractApplication $app) {

        $js = "";

        // On ajoute le domReady par défaut.
        $this->addRequireJSModule('domReady', 'js/vendor/domReady.min');

        // On ajoute les trads.
        if (count(self::$strings)) {
            $this->requireJS("etdsolutions/text", "text.load(" . json_encode(self::$strings) . ")", true);
        }

        // On ajoute la conservation de la session.
        if (self::$keepSession) {
            $interval = floor((int)$app->get('session_expire') / 2) * 60;
            $this->requireJS("jquery", "window.setInterval(function(){\$.get('" . $app->get('uri.base.full') . "?stayAlive=true')}," . $interval . ");", true);
        }

        // On crée la configuration de requireJS
        $js .= "requirejs.config({\n";
        $js .= "\tbaseUrl: '" . $app->get('uri.base.full') . "',\n";

        // Debug => cache bust
        if ($app->get('debug', false)) {
            $js .= "\turlArgs: 'bust=' +  (new Date()).getTime(),\n";
            $js .= "\twaitSeconds: 0,\n";
        } elseif ($app->get('assets.version') !== null) {
            $js .= "\turlArgs: 'v=" . $app->get('assets.version') . "',\n";
        }

        // map
        $js .= "\tmap: " . json_encode(self::$requireMap);

        // packages
        if (count(self::$requirePackages)) {
            $js .= ",\n\tpackages: " . json_encode(array_values(self::$requirePackages));
        }

        // modules
        if (count(self::$requireModules)) {

            $shim  = array();
            $paths = array();
            foreach (self::$requireModules as $module) {
                $paths[] = "\t\t" . json_encode($module['module']) . ": " . json_encode($module['path']);
                if ($module['shim'] !== false) {
                    $shim[] = "\t\t" . json_encode($module['module']) . ": " . json_encode($module['shim']);
                }
            }

            if (count($shim)) {
                $js .= ",\n\tshim: {\n";
                $js .= implode(",\n", $shim) . "\n";
                $js .= "\t}";
            }
            if (count($paths)) {
                $js .= ",\n\tpaths: {\n";
                $js .= implode(",\n", $paths) . "\n";
                $js .= "\t}";
            }

        }

        $js .= "\n});\n";

        if (count(self::$requireJS)) {

            foreach (self::$requireJS as $id => $scripts) {

                $content      = "";
                $req_modules  = explode(",", preg_replace("/:[a-zA-Z]{1,}/", "", $id));
                $func_modules = explode(",", $id);

                foreach ($scripts as $script) {
                    if (!empty($script)) {
                        $content .= "  " . $script . "\n";
                    }
                }

                $js .= "require(" . json_encode($req_modules);

                if (!empty($content)) {
                    $modules = array_filter($func_modules, function ($module) {

                        return (strpos($module, '!') === false);
                    });
                    $modules = array_map(function ($module) {

                        if (strpos($module, ":") !== false) {
                            $module = substr($module, strrpos($module, ':') + 1);
                        }

                        if (strpos($module, '/') !== false) {
                            $module = substr($module, strrpos($module, '/') + 1);
                        }

                        if (strpos($module, '.min') !== false) {
                            $module = str_replace('.min', '', $module);
                        }

                        if (strpos($module, '.') !== false) {
                            $module = substr($module, strrpos($module, '.') + 1);
                        }

                        $module = str_replace('-', '', $module);

                        return $module;
                    }, $modules);
                    $js .= ", function(" . implode(",", $modules) . ") {\n";
                    $js .= $content;
                    $js .= "}";
                }

                $js .= ");\n";

            }
        }

        // On minifie le JS.
        if ($app->get('minify_inline_js')) {

            if (!class_exists("\\MatthiasMullie\\Minify\\JS")) {
                throw new RuntimeException("Le paquet matthiasmullie/minify n'est pas installé. Exécuter &quot;composer require matthiasmullie/minify&quot;");
            }

            $minifier = new \MatthiasMullie\Minify\JS();
            $minifier->add($js);
            $js = $minifier->minify();

        }

        return $js;

    }
1270854
function Widget(options) {
  this.__data = {};
  try {
    var e;
    if (typeof options === 'undefined') options = {};
    if (typeof options.innerHTML !== 'undefined' && typeof options.childNodes !== 'undefined') {
      // On passe directement un élément.
      options = {element: options};
    }
    if (typeof options.tag === 'undefined') options.tag = "div";
    if (options.element) {
      this.element(options.element);
    } else if (typeof options.id !== 'undefined') {
      e = window.document.getElementById(options.id);
      if (!e) {
        throw Error("Can't find element with id: \"" + options.id + "\"!");
      }
      this.element(e);
    } else {
      this.element(window.document.createElement(options.tag));
      this.addClass("wdg", "custom");
    }
  }
  catch (ex) {
    console.error("[widget] ", ex);
    console.error("[Widget] ", JSON.stringify(options));
    throw Error(ex);
  }
}