Y-SLD/assets/js/map-preview.js.map

1 line
6.4 KiB
Plaintext
Raw Permalink Normal View History

2024-03-01 11:23:55 +00:00
{"version":3,"sources":["layer-preview.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"map-preview.js","sourcesContent":["L.TileLayer.BetterWMS = L.TileLayer.WMS.extend({\r\n\r\n onAdd: function (map) {\r\n // Triggered when the layer is added to a map.\r\n // Register a click listener, then do all the upstream WMS things\r\n L.TileLayer.WMS.prototype.onAdd.call(this, map);\r\n map.on('click', this.getFeatureInfo, this);\r\n },\r\n\r\n onRemove: function (map) {\r\n // Triggered when the layer is removed from a map.\r\n // Unregister a click listener, then do all the upstream WMS things\r\n L.TileLayer.WMS.prototype.onRemove.call(this, map);\r\n map.off('click', this.getFeatureInfo, this);\r\n },\r\n\r\n getFeatureInfo: function (evt) {\r\n // Make an AJAX request to the server and hope for the best\r\n var url = this.getFeatureInfoUrl(evt.latlng),\r\n showResults = L.Util.bind(this.showGetFeatureInfo, this);\r\n $.ajax({\r\n url: url,\r\n success: function (data, status, xhr) {\r\n var err = typeof data === 'string' ? null : data;\r\n showResults(err, evt.latlng, data);\r\n },\r\n error: function (xhr, status, error) {\r\n showResults(error);\r\n }\r\n });\r\n },\r\n\r\n getFeatureInfoUrl: function (latlng) {\r\n // Construct a GetFeatureInfo request URL given a point\r\n var point = this._map.latLngToContainerPoint(latlng, this._map.getZoom()),\r\n size = this._map.getSize(),\r\n params = {\r\n request: 'GetFeatureInfo',\r\n service: 'WMS',\r\n srs: 'EPSG:4326',\r\n styles: this.wmsParams.styles,\r\n transparent: this.wmsParams.transparent,\r\n version: this.wmsParams.version,\r\n format: this.wmsParams.format,\r\n bbox: this._map.getBounds().toBBoxString(),\r\n height: size.y,\r\n width: size.x,\r\n layers: this.wmsParams.layers,\r\n query_layers: this.wmsParams.layers,\r\n info_format: 'text/html'\r\n };\r\n\r\n params[params.version === '1.3.0' ? 'i' : 'x'] = point.x;\r\n params[params.version === '1.3.0' ? 'j' : 'y'] = point.y;\r\n\r\n return this._url + L.Util.getParamString(params, this._url, true);\r\n },\r\n\r\n showGetFeatureInfo: function (err, latlng, content) {\r\n if (err) {\r\n console.log(err);\r\n return;\r\n } // do nothing if there's an error\r\n\r\n\r\n if (jQuery(content).find(\"tr\").length < 2) {\r\n return;\r\n }\r\n\r\n content = content.toLowerCase();\r\n\r\n //var content = content.replace('/g', \"<table\");\r\n\r\n jQuery(content).filter(\"table\").addClass(\"table\");\r\n\r\n // Otherwise show the content in a popup, or something.\r\n L.popup({maxWidth: 'auto'})\r\n .setLatLng(latlng)\r\n .setContent(content)\r\n .openOn(this._map);\r\n\r\n//