{"version":3,"sources":["assets/icons.js","main.js"],"names":["locationString","String","raw","clubString","courtString","iceString","playgroundString","recString","sportString","trackString","waterString","ymcaString","module","exports","svgStrings","require","mapsURL","layersIndex","recC","ymca","clubs","playgrounds","sportsF","courts","track","iceH","waterF","vars_dict","pop_name","pop_address","pop_city","pop_state","pop_website","pop_conp","pop_phone","pop_phonep","pop_email","pop_service","pop_ageRange","pop_hours","pop_town","popupHTMLs","vals","includes","length","capitalizeFirstLetter","nameS","result","words","split","lowerWords","upperWords","forEach","word","toLowerCase","toUpperCase","charAt","slice","originalOnAdd","L","Marker","prototype","onAdd","originalOnRemove","onRemove","mergeOptions","bounceOnAdd","bounceOnAddOptions","duration","height","loop","bounceOnAddCallback","include","_toPoint","latlng","_map","latLngToContainerPoint","_toLatLng","point","containerPointToLatLng","_motionStep","opts","self","progress","Date","start","delta","_easeOutBounce","step","_animationId","Util","requestAnimFrame","timestamp","end","_bounceMotion","callback","original","latLng","_origLatlng","start_y","_dropPoint","y","start_x","x","distance","_point","project","getCenter","_origMapCenter","setLatLng","pos","bounce","options","endCallback","arguments","_getDropPoint","stopBounce","cancelAnimFrame","top_y","undefined","getBounds","_northEast","Point","map","call","getLatLng","markerL","svgs","iconL","divIcon","className","html","popupAnchor","mapLink","userLink","dropdown_span","document","querySelector","icons","s","layers","center","zoom","attribution","tileLayer","addTo","locate","setView","maxZoom","enableHighAccuracy","addEventListener","e","panTo","animate","marker","icon","bindPopup","openPopup","Object","keys","item","esri","featureLayer","url","pointToLayer","geojson","pane","createPane","onEachFeature","f","lyr","content","setPopup","geocode_point","lyrLinks","querySelectorAll","feature","lyrName","var_dict","attrs","properties","key","lyrLink","lyrSlected","currentTarget","getAttribute","hasLayer","removeLayer","addLayer","innerHTML","southWest","northEast","bounds","latLngBounds","geocoder","Geocoding","geosearch","position","searchBounds","title","placeholder","zoomToResult","geocoder_result","layerGroup","get_nearest","feature_layer","factor","arr_points","eachFeature","layer","fid_dis_point","coor","lat","geometry","coordinates","lng","point_current","id","dis","fid","push","sort","a","b","top3","fitbounds","element","values","results","clearLayers","result_1st","riseOnHover","nearest_points","nearest_bounds","fitBounds","flyTo"],"mappings":";AAgCA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,uqEAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,q1EAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,6oCAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,+0BAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,kiCAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,8lEAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,4uBAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,+0BAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,6iDAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,IAAA,IAAA,EAAA,EAAA,CAAA,ufAAA,OAAA,EAAA,WAAA,OAAA,GAAA,EAAA,SAAA,EAAA,EAAA,GAAA,OAAA,IAAA,EAAA,EAAA,MAAA,IAAA,OAAA,OAAA,OAAA,iBAAA,EAAA,CAAA,IAAA,CAAA,MAAA,OAAA,OAAA,OAhCA,IAAIA,EAAiBC,OAAOC,IAA5B,KAGIC,EAAaF,OAAOC,IAAxB,KAKIE,EAAcH,OAAOC,IAAzB,KAEIG,EAAYJ,OAAOC,IAAvB,KAGII,EAAmBL,OAAOC,IAA9B,KAGIK,EAAYN,OAAOC,IAAvB,KAGIM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E+F,OAAO4E,EAAY,CAACC,aAAY,EAAM5E,KAAK3B,KAClEwG,IAAAA,EAAiB5B,EAAY0B,EAAW3G,EAAKiB,EAAOvH,YAAa,GAEjEoN,EAAiB9K,EAAEsI,aAAauC,GACpC7G,EAAI+G,UAAUD,GACd9G,EAAIgH,MAAML","file":"main.2b42e6ce.js","sourceRoot":"..","sourcesContent":["let locationString = String.raw`\r\n\r\n`;\r\nlet clubString = String.raw`\r\n\r\n\r\n`;\r\n\r\nlet courtString = String.raw`\r\n`;\r\nlet iceString = String.raw`\r\nice, hockey, winter, snow, sports\r\n`;\r\nlet playgroundString = String.raw`\r\n\r\n`;\r\nlet recString = String.raw`\r\n\r\n`;\r\nlet sportString = String.raw`\r\n`;\r\nlet trackString = String.raw`\r\n\r\n`;\r\nlet waterString = String.raw`\r\n\r\n`;\r\n\r\nlet ymcaString = String.raw`\r\n\r\n`;\r\n\r\nmodule.exports = {locationString, clubString, courtString, iceString, playgroundString, recString, sportString, trackString, waterString,ymcaString };\r\n\r\n\r\n\r\n","let svgStrings = require(\"./assets/icons\");\r\nconst mapsURL = 'https://services.arcgis.com/8veDRDlhXWywYP3S/ArcGIS/rest/services/PhysicalActivity_View_Layer/FeatureServer';\r\nconst layersIndex = {recC: 0, ymca: 1, clubs: 2, playgrounds: 3, sportsF: 4, courts: 5, track: 6, iceH: 7, waterF: 8};\r\nconst vars_dict = {\r\n recC: {pop_name: 'Name', pop_address: 'Match_addr'},\r\n ymca: {pop_name: 'USER_Progr',\r\n pop_address: 'USER_Addre',\r\n pop_city: 'USER_City',\r\n pop_state: 'USER_State',\r\n pop_website: 'USER_Websi',\r\n pop_conp: 'USER_Name_',\r\n pop_phone: 'USER_Phone',\r\n pop_phonep: 'USER_Con_1',\r\n pop_email: 'USER_Conta',\r\n pop_service: 'USER_Activ',\r\n pop_ageRange: 'USER_Age_R',\r\n pop_hours: 'USER_Hours'},\r\n clubs: {pop_name: 'USER_Progr',\r\n pop_address: 'USER_Addre',\r\n pop_city: 'USER_City',\r\n pop_state: 'USER_State',\r\n pop_website: 'USER_Websi',\r\n pop_conp: 'USER_Name_',\r\n pop_phone: 'USER_Phone',\r\n pop_phonep: 'USER_Con_1',\r\n pop_email: 'USER_Conta',\r\n pop_service: 'USER_Activ',\r\n pop_ageRange: 'USER_Age_R',\r\n pop_hours: 'USER_Hours'},\r\n playgrounds: {pop_name: 'F_Name', pop_address: 'Street', pop_town: 'Town'},\r\n sportsF: {pop_name: 'F_Name', pop_address: 'Street', pop_town: 'Town'},\r\n courts: {pop_name: 'F_Name', pop_address: 'Street', pop_town: 'Town'},\r\n track: {pop_name: 'F_Name', pop_address: 'Street', pop_town: 'Town'},\r\n iceH: {pop_name: 'F_Name', pop_address: 'Street', pop_town: 'Town'},\r\n waterF: {pop_name: 'F_Name', pop_address: 'Street', pop_town: 'Town'}\r\n};\r\n//pop-up attributes\r\nvar popupHTMLs = {\r\n recC: function (vals){return `
${vals.pop_name}

Address: ${vals.pop_address}
`},\r\n ymca: function (vals) {return `
${vals.pop_name}

\r\nAddress: ${vals.pop_address}, ${vals.pop_city}, ${vals.pop_state}
\r\n${vals.pop_conp!='n/a' && vals.pop_conp.length>2? 'Contact: '+vals.pop_conp +'
': '' }\r\n${vals.pop_phone.length>2? 'Phone: '+vals.pop_phone+'
':''}\r\n
\r\n${vals.pop_service && vals.pop_service.length>2? 'Service: '+vals.pop_service+'
':''}\r\n${vals.pop_ageRange && vals.pop_ageRange.length>2? 'Age Range of Program: '+vals.pop_ageRange+'
':''}\r\n${vals.pop_hours && vals.pop_hours.length>2? 'Hours Comments: '+vals.pop_hours+'
':''}`},\r\n clubs: function (vals) {return `
${vals.pop_name}

\r\nAddress: ${vals.pop_address}, ${vals.pop_city}, ${vals.pop_state}
\r\n${vals.pop_conp!='n/a' && vals.pop_conp.length>2? 'Contact: '+vals.pop_conp +'
': '' }\r\n${vals.pop_phone.length>2? 'Phone: '+vals.pop_phone+'
':''}\r\n
\r\n${vals.pop_service && vals.pop_service.length>2? 'Service: '+vals.pop_service+'
':''}\r\n${vals.pop_ageRange && vals.pop_ageRange.length>2? 'Age Range of Program: '+vals.pop_ageRange+'
':''}\r\n${vals.pop_hours && vals.pop_hours.length>2? 'Hours Comments: '+vals.pop_hours+'
':''}`},\r\n playgrounds: function (vals) {return`
${vals.pop_name}

Address: ${vals.pop_address}, ${vals.pop_town}
`},\r\n sportsF: function (vals) {return`
${vals.pop_name}

Address: ${vals.pop_address}, ${vals.pop_town}
`} ,\r\n courts: function (vals) {return`
${vals.pop_name}

Address: ${vals.pop_address}, ${vals.pop_town}
`},\r\n track: function (vals) {return`
${vals.pop_name}

Address: ${vals.pop_address}, ${vals.pop_town}
`},\r\n iceH: function (vals) {return`
${vals.pop_name}

Address: ${vals.pop_address}, ${vals.pop_town}
`},\r\n waterF:function (vals) {return`
${vals.pop_name}

Address: ${vals.pop_address}, ${vals.pop_town}
`},\r\n\r\n};\r\n\r\n\r\n//Code snippet of BounceMarker\r\n/**\r\n * Copyright (C) 2013 Maxime Hadjinlian \r\n * All Rights Reserved.\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * - Redistributions of source code must retain the above copyright notice,\r\n * this list of conditions and the following disclaimer.\r\n *\r\n * - Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n */\r\n\r\n(function() {\r\n // Retain the value of the original onAdd and onRemove functions\r\n let originalOnAdd = L.Marker.prototype.onAdd;\r\n let originalOnRemove = L.Marker.prototype.onRemove;\r\n\r\n // Add bounceonAdd options\r\n L.Marker.mergeOptions({\r\n bounceOnAdd: false,\r\n bounceOnAddOptions: {\r\n duration: 1000,\r\n height: -1,\r\n loop: 1,\r\n },\r\n bounceOnAddCallback: function() {},\r\n });\r\n\r\n L.Marker.include({\r\n\r\n _toPoint: function(latlng) {\r\n return this._map.latLngToContainerPoint(latlng);\r\n },\r\n\r\n _toLatLng: function(point) {\r\n return this._map.containerPointToLatLng(point);\r\n },\r\n\r\n _motionStep: function(opts) {\r\n let self = this;\r\n let timePassed = new Date() - opts.start;\r\n let progress = timePassed / opts.duration;\r\n\r\n if (progress > 1) {\r\n progress = 1;\r\n }\r\n\r\n let delta = self._easeOutBounce(progress);\r\n opts.step(delta);\r\n\r\n if (progress === 1) {\r\n opts.start = new Date();\r\n progress = 0;\r\n if (opts.loop > 0) opts.loop = opts.loop - 1;\r\n if (opts.loop === 0) {\r\n opts.end();\r\n return;\r\n }\r\n }\r\n\r\n self._animationId = L.Util.requestAnimFrame(function(timestamp) {\r\n self._motionStep(opts);\r\n });\r\n },\r\n\r\n _bounceMotion: function(opts, callback) {\r\n let original = L.latLng(this._origLatlng);\r\n let start_y = this._dropPoint.y;\r\n let start_x = this._dropPoint.x;\r\n let distance = this._point.y - start_y;\r\n let self = this;\r\n\r\n self._animationId = L.Util.requestAnimFrame(function() {\r\n self._motionStep({\r\n duration: opts.duration || 1000, // 1 sec by default\r\n loop: opts.loop || 1,\r\n start: new Date(),\r\n step: function(delta) {\r\n self._dropPoint.y =\r\n start_y\r\n + (distance * delta)\r\n - (self._map.project(self._map.getCenter()).y - self._origMapCenter.y);\r\n self._dropPoint.x =\r\n start_x\r\n - (self._map.project(self._map.getCenter()).x - self._origMapCenter.x);\r\n self.setLatLng(self._toLatLng(self._dropPoint));\r\n },\r\n end: function() {\r\n self.setLatLng(original);\r\n if (typeof callback === 'function') callback();\r\n },\r\n });\r\n });\r\n },\r\n\r\n // Many thanks to Robert Penner for this function\r\n _easeOutBounce: function(pos) {\r\n if ((pos) < (1 / 2.75)) {\r\n return (7.5625 * pos * pos);\r\n } else if (pos < (2 / 2.75)) {\r\n return (7.5625 * (pos -= (1.5 / 2.75)) * pos + 0.75);\r\n } else if (pos < (2.5 / 2.75)) {\r\n return (7.5625 * (pos -= (2.25 / 2.75)) * pos + 0.9375);\r\n } else {\r\n return (7.5625 * (pos -= (2.625 / 2.75)) * pos + 0.984375);\r\n }\r\n },\r\n\r\n // Bounce : if options.height in pixels is not specified, drop from top.\r\n // If options.duration is not specified animation is 1s long.\r\n bounce: function(options, endCallback) {\r\n if (typeof options === 'function') {\r\n endCallback = options;\r\n options = null;\r\n }\r\n options = options || {duration: 1000, height: -1, loop: 1};\r\n\r\n // backward compatibility\r\n if (typeof options === 'number') {\r\n options.duration = arguments[0];\r\n options.height = arguments[1];\r\n }\r\n\r\n // Keep original map center\r\n this._origMapCenter = this._map.project(this._map.getCenter());\r\n this._dropPoint = this._getDropPoint(options.height);\r\n this._bounceMotion(options, endCallback);\r\n },\r\n\r\n stopBounce: function(){\r\n // We may have modified the marker; so we need to place it where it\r\n // belongs so next time its coordinates are not changed.\r\n this.setLatLng(this._origLatlng);\r\n L.Util.cancelAnimFrame(this._animationId);\r\n },\r\n\r\n // This will get you a drop point given a height.\r\n // If no height is given, the top y will be used.\r\n _getDropPoint: function(height) {\r\n // Get current coordidates in pixel\r\n this._point = this._toPoint(this._origLatlng);\r\n let top_y;\r\n if (height === undefined || height < 0) {\r\n top_y = this._toPoint(this._map.getBounds()._northEast).y;\r\n } else {\r\n top_y = this._point.y - height;\r\n }\r\n return new L.Point(this._point.x, top_y);\r\n },\r\n\r\n onAdd: function(map) {\r\n this._map = map;\r\n\r\n // Call leaflet original method to add the Marker to the map.\r\n originalOnAdd.call(this, map);\r\n\r\n // Keep original latitude and longitude\r\n this._origLatlng = this.getLatLng();\r\n\r\n if (this.options.bounceOnAdd === true) {\r\n this.bounce(this.options.bounceOnAddOptions, this.options.bounceOnAddCallback);\r\n }\r\n },\r\n\r\n onRemove: function(map) {\r\n this.stopBounce();\r\n originalOnRemove.call(this, map);\r\n },\r\n });\r\n})();\r\n//END of Bouncermarker.js\r\n\r\n//Capitalize a string\r\nfunction capitalizeFirstLetter(nameS) {\r\n let result = ''\r\n let words = nameS.split(' ');\r\n let lowerWords = ['of', 'and'];\r\n let upperWords = ['llc']\r\n words.forEach(function (word) {\r\n word = word.toLowerCase();\r\n if (upperWords.includes(word)){result += word.toUpperCase()+' ';}\r\n else if (lowerWords.includes(word)){result += word+' ';}\r\n else{result += word.charAt(0).toUpperCase()+word.slice(1)+' ';}\r\n\r\n })\r\n return result;\r\n\r\n}\r\n//end of capitalization of words\r\n\r\n//Icon setting\r\n//Icons\r\nconst svgs = {recC: svgStrings.recString,\r\n ymca: svgStrings.ymcaString,\r\n clubs: svgStrings.clubString,\r\n playgrounds: svgStrings.playgroundString,\r\n sportsF: svgStrings.sportString,\r\n courts: svgStrings.courtString,\r\n track: svgStrings.trackString,\r\n iceH: svgStrings.iceString,\r\n waterF:svgStrings.waterString};\r\n\r\nlet iconL = L.divIcon({\r\n className: \"myDivIcon locate\",\r\n html: svgStrings.locationString,\r\n popupAnchor: [10,0]\r\n});\r\nlet markerL; //marker created by geolocating\r\n\r\n\r\nconst mapLink = 'OpenStreetMap';\r\nconst userLink = 'Guixing Wei@S4';\r\n\r\n\r\nlet dropdown_span = document.querySelector('#layers-toggle span');\r\nlet icons = {};\r\n\r\n\r\nfor (const s in svgs){\r\n icons[s] = L.divIcon({\r\n className: `myDivIcon ${s}`,\r\n html: svgs[s],\r\n popupAnchor: [10,0]\r\n })\r\n}\r\nvar layers = {}; //containers of all feature layers\r\n\r\nlet map = L.map('map',\r\n {\r\n center: [41.825606, -71.407919],\r\n zoom: 13,\r\n });\r\n\r\nlet attribution = '©' + mapLink + 'Developer '+ '| ©' + userLink + '';\r\nL.tileLayer('https://{s}.tile.osm.org/{z}/{x}/{y}.png',{\r\n attribution:attribution,\r\n}).addTo(map);\r\n\r\n//map locate\r\nmap.locate({\r\n setView: false,\r\n maxZoom: 13,\r\n enableHighAccuracy: true,\r\n});\r\nmap.addEventListener('locationfound', function (e) {\r\n map.panTo(e.latlng, {animate: false});\r\n markerL = new L.marker(e.latlng,\r\n {icon: iconL,\r\n bounceOnAdd: true,\r\n bounceOnAddOptions: {duration:1500}\r\n })\r\n .bindPopup(\"You are here!\")\r\n .addTo(map).openPopup();\r\n\r\n\r\n\r\n\r\n});\r\nmap.addEventListener('locationerror', function (e) {\r\n //alert(\"Unable to locate; please enable your browser's location service!\");\r\n});\r\n//end of map locating\r\n\r\n//load all feature layers to map\r\nObject.keys(layersIndex).forEach(item => {\r\n\r\n layers[item] = L.esri.featureLayer({\r\n url: `${mapsURL}/${layersIndex[item]}`,\r\n pointToLayer: (geojson, latlng)=>{\r\n return L.marker(latlng, {icon: icons[item],pane: map.createPane(String(item))});},\r\n onEachFeature: (f, lyr)=>{\r\n let content = setPopup(f, item);\r\n lyr.bindPopup(content).addTo(map);\r\n }\r\n\r\n });\r\n layers[item].addTo(map);\r\n});\r\n\r\n//add eventlistener to layerWin item\r\nlet lyrLinks = document.querySelectorAll(\"#layerSel a\");\r\nlyrLinks.forEach(lyrLink=>{\r\n lyrLink.addEventListener('click',e =>{\r\n let lyrSlected = e.currentTarget.getAttribute(\"data-value\");\r\n Object.keys(layers).forEach(lyr => {\r\n if (lyr != lyrSlected && map.hasLayer(layers[lyr])) {map.removeLayer(layers[lyr]);}\r\n else if (lyr == lyrSlected && ! map.hasLayer(layers[lyr])) {map.addLayer(layers[lyr]);}\r\n else{}\r\n });\r\n //update the text of the dropdown button\r\n dropdown_span.innerHTML = e.currentTarget.innerHTML;\r\n\r\n\r\n })\r\n})\r\n\r\nfunction setPopup(feature, lyrName){\r\n\r\n let var_dict = vars_dict[lyrName];\r\n let attrs = feature.properties;\r\n let vals = {};\r\n Object.keys(var_dict).forEach(key => {\r\n vals[key] = attrs[var_dict[key]];\r\n })\r\n let content = popupHTMLs[lyrName](vals);\r\n\r\n return content;\r\n}\r\n\r\n//add geocoder control\r\n\r\nlet geocode_point;\r\nconst southWest = L.latLng(41.363407,-71.829872),\r\n northEast = L.latLng(42.006935,-71.250924),\r\n bounds = L.latLngBounds(southWest,northEast);\r\nlet geocoder = L.esri.Geocoding.geosearch({\r\n position: 'topleft',\r\n searchBounds: bounds,\r\n title: \"Put in your address to find practices near you\",\r\n placeholder: \"RI Address search\",\r\n zoomToResult: false\r\n}).addTo(map);\r\nlet geocoder_result = L.layerGroup().addTo(map);\r\ngeocoder.addEventListener('results', results=>{\r\n geocoder_result.clearLayers();\r\n if (markerL != undefined) {\r\n map.removeLayer(markerL);\r\n };\r\n let result_1st = results.results[0].latlng;\r\n geocoder_result.addLayer(L.marker(result_1st, {riseOnHover:true, icon:iconL}));\r\n let nearest_points = get_nearest(result_1st,map, layers.playgrounds ,8);\r\n //console.log(nearest_points);\r\n let nearest_bounds = L.latLngBounds(nearest_points);\r\n map.fitBounds(nearest_bounds);\r\n map.flyTo(result_1st);\r\n\r\n});\r\n\r\n\r\nfunction get_nearest(point,map,feature_layer,factor = 5){\r\n let arr_points = [];\r\n feature_layer.eachFeature(function(layer) {\r\n let feature = layer.feature;\r\n let fid_dis_point = {};\r\n //console.log(feature);\r\n let coor = {lat:feature.geometry.coordinates[1], lng: feature.geometry.coordinates[0]};\r\n let point_current = L.latLng(coor);\r\n let id = feature.id;\r\n let dis = map.distance(point_current,point);\r\n fid_dis_point.fid = id;\r\n fid_dis_point.dis = dis;\r\n fid_dis_point.point = point_current;\r\n arr_points.push(fid_dis_point);\r\n });\r\n arr_points.sort((a,b)=> (a.dis > b.dis)? 1:-1);\r\n let top3 = arr_points.slice(0,factor);\r\n let bounds = [point];\r\n let fitbounds =[];\r\n top3.forEach(function (element) {\r\n bounds.push(element.point);\r\n });\r\n bounds.forEach(function (x) {\r\n fitbounds.push(Object.values(x));\r\n });\r\n return fitbounds;\r\n};\r\n\r\n"]}