Valider c938521e rédigé par kent1@arscenic.info's avatar kent1@arscenic.info
Parcourir les fichiers

Passage d'eslint avec une configuration par défaut (même que...

Passage d'eslint avec une configuration par défaut (même que https://github.com/shramov/leaflet-plugins)
parent 9969a914
Chargement en cours
Chargement en cours
Chargement en cours
Chargement en cours
+61 −61
Numéro de ligne d'origine Numéro de ligne de diff Ligne de diff
@@ -31,13 +31,13 @@ L.Map.Gis = L.Map.extend({
		openId: false,
		affiche_points: true,
		json_points: {
			url: "",
			objets: "",
			url: '',
			objets: '',
			limit: 500,
			env: [],
			titre: "",
			description: "",
			icone: ""
			titre: '',
			description: '',
			icone: ''
		},
		localize_visitor: false,
		localize_visitor_zoom: 0,
@@ -51,14 +51,14 @@ L.Map.Gis = L.Map.extend({
	initialize: function (id,options) {
		L.Util.setOptions(this, options);
		
		this.on('load',function(e){
		this.on('load', function () {
			// Affecter sur l'objet du DOM
			jQuery("#"+this._container.id).get(0).map = this;
			jQuery('#'+this._container.id).get(0).map = this;
			// Appeler l'éventuelle fonction de callback
			if (this.options.callback && typeof(this.options.callback) === "function")
			if (this.options.callback && typeof(this.options.callback) === 'function')
				this.options.callback(this);
			// trigger load sur l'objet du DOM
			jQuery("#"+this._container.id).trigger('load',this);
			jQuery('#'+this._container.id).trigger('load',this);
		});
		
		L.Map.prototype.initialize.call(this, id, options);
@@ -91,10 +91,10 @@ L.Map.Gis = L.Map.extend({
		
		// Si pas de points affichés trigger ready ici
		if (!this.options.affiche_points || !this.options.json_points.length)
			jQuery("#"+this._container.id).trigger('ready',this);
			jQuery('#'+this._container.id).trigger('ready',this);
	},

	populateTileLayers: function (tilelayers) {
	populateTileLayers: function () {
		// Fond de carte par défaut
		var default_layer = this.createTileLayer(this.options.default_layer);
		this.addLayer(default_layer);
@@ -105,7 +105,7 @@ L.Map.Gis = L.Map.extend({
			for (var l in this.options.affiche_layers) {
				if (this.options.affiche_layers[l]!==this.options.default_layer) {
					var layer = this.createTileLayer(this.options.affiche_layers[l]);
					if (typeof layer!=="undefined")
					if (typeof layer!=='undefined')
						layers_control.addBaseLayer(layer,this.options.gis_layers[this.options.affiche_layers[l]].nom);
				}
			}
@@ -130,8 +130,8 @@ L.Map.Gis = L.Map.extend({
	
	createTileLayer: function (name) {
		var layer;
		if (typeof this.options.gis_layers[name]!=="undefined")
			eval("layer=new "+ this.options.gis_layers[name].layer +";");
		if (typeof this.options.gis_layers[name]!=='undefined')
			eval('layer=new '+ this.options.gis_layers[name].layer +';');
		return layer;
	},

@@ -182,7 +182,7 @@ L.Map.Gis = L.Map.extend({
					},
					onEachFeature: function (feature, layer) {
						// Déclarer l'icone du point
						if (feature.geometry.type == "Point") {
						if (feature.geometry.type == 'Point') {
							map.setGeoJsonFeatureIcon(feature, layer);
						}
						// Déclarer le contenu de la popup s'il y en a
@@ -199,7 +199,7 @@ L.Map.Gis = L.Map.extend({
				if (map.options.openId)
					gis_focus_marker(map.options.openId,map.options.mapId);

				if (typeof map.geojsons=="undefined") map.geojsons = [];
				if (typeof map.geojsons=='undefined') map.geojsons = [];
				map.geojsons.push(geojson);
			}
		} else {
@@ -211,7 +211,7 @@ L.Map.Gis = L.Map.extend({
					var marker = L.marker([feature.geometry.coordinates[1], feature.geometry.coordinates[0]]);

					// Déclarer l'icone du point
					if (feature.geometry.type == "Point") {
					if (feature.geometry.type == 'Point') {
						map.setGeoJsonFeatureIcon(feature, marker);
					}
					// Déclarer le contenu de la popup s'il y en a
@@ -240,7 +240,7 @@ L.Map.Gis = L.Map.extend({
	
	// API Compat GIS3
	removeAllMarkers: function () {
		if (typeof this.geojsons=="undefined") this.geojsons = [];
		if (typeof this.geojsons=='undefined') this.geojsons = [];
		for (var i in this.geojsons) {
			this.geojsons[i].clearLayers();
			this.removeLayer(this.geojsons[i]);
@@ -251,32 +251,32 @@ L.Map.Gis = L.Map.extend({
	loadData: function () {
		var map = this;
		if (map.options.affiche_points
			&& typeof(map.options.json_points) !== "undefined"
			&& typeof(map.options.json_points) !== 'undefined'
			&& map.options.json_points.url.length) {
			// Récupération des points à mettre sur la carte, via json externe
			var args = {};
			jQuery.extend(true, args, map.options.json_points.env);
			if (typeof map.options.json_points.objets !== "undefined"){
			if (typeof map.options.json_points.objets !== 'undefined') {
				args.objets = map.options.json_points.objets;
				if (args.objets == "point_libre"){
				if (args.objets == 'point_libre') {
					args.lat = map.options.center[0];
					args.lon = map.options.center[1];
					if (typeof map.options.json_points.titre !== "undefined")
					if (typeof map.options.json_points.titre !== 'undefined')
						args.titre = map.options.json_points.titre;
					if (typeof map.options.json_points.description !== "undefined")
					if (typeof map.options.json_points.description !== 'undefined')
						args.description = map.options.json_points.description;
					if (typeof map.options.json_points.icone !== "undefined")
					if (typeof map.options.json_points.icone !== 'undefined')
						args.icone = map.options.json_points.icone;
				}
			}
			if (typeof map.options.json_points.limit !== "undefined")
			if (typeof map.options.json_points.limit !== 'undefined')
				args.limit = map.options.json_points.limit;
			jQuery.getJSON(map.options.json_points.url,args,
				function (data) {
					if (data) {
						// Charger le json (data) et déclarer les points
						map.parseGeoJson(data);
						jQuery("#"+map._container.id).trigger('ready',map);
						jQuery('#'+map._container.id).trigger('ready',map);
					}
				}
			);
@@ -290,7 +290,7 @@ L.Map.Gis = L.Map.extend({
			for (var i in map.options.kml) {
				map.kml[i] = new L.KML(map.options.kml[i], {async: true});
				if (map.options.centrer_fichier)
					map.kml[i].on("loaded", function(e) { map.fitBounds(e.target.getBounds()); });
					map.kml[i].on('loaded', function (e) { map.fitBounds(e.target.getBounds()); });
				map.addLayer(map.kml[i]);
			}
		}
@@ -299,7 +299,7 @@ L.Map.Gis = L.Map.extend({
			for (var i in map.options.gpx) {
				map.gpx[i] = new L.GPX(map.options.gpx[i], {async: true});
				if (map.options.centrer_fichier)
					map.gpx[i].on("loaded", function(e) { map.fitBounds(e.target.getBounds()); });
					map.gpx[i].on('loaded', function (e) { map.fitBounds(e.target.getBounds()); });
				map.addLayer(map.gpx[i]);
			}
		}
@@ -315,7 +315,7 @@ L.Map.Gis = L.Map.extend({
			for (var i in map.options.topojson) {
				map.topojson[i] = new L.TOPOJSON(map.options.topojson[i], {async: true});
				if (map.options.centrer_fichier) {
					map.topojson[i].on("loaded", function(e) { map.fitBounds(e.target.getBounds()); });
					map.topojson[i].on('loaded', function (e) { map.fitBounds(e.target.getBounds()); });
				}
				map.addLayer(map.topojson[i]);
			}