` + `` + `
` + e.features[0].properties.park_name + `
` + `` + `` + ` `;
// Ensure that if the map is zoomed out such that multiple
// copies of the feature are visible, the popup appears
// over the copy being pointed to.
while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;
}
// add Popup to map
new mapboxgl.Popup()
.setLngLat(coordinates)
.setHTML(description)
.addTo(map);
});
// Change the cursor to a pointer when the mouse is over the places layer.
map.on('mouseenter', 'csvData', function () {
map.getCanvas().style.cursor = 'pointer';
});
// Change it back to a pointer when it leaves.
map.on('mouseleave', 'csvData', function () {
map.getCanvas().style.cursor = '';
});
var bbox = turf.bbox(data);
map.fitBounds(bbox, { padding: 50 });
function forwardGeocoder(query) {
var matchingFeatures = [];
for (var i = 0; i ` + `` + `