leaflet

leaflet.js api icons: why do iconAnchor and popupAnchor have different coordinate locations

百般思念 提交于 2020-01-01 05:03:42
问题 If I configure leaflet icons in the following way, the popup is anchored at the upper left of the the icon. iconUrl: 'images/Flaticon_10030-16px.png', iconAnchor: [0,0], popupAnchor: [0,0] Also, with this setting, I'm not sure that the icon anchor is located at the latlng location. I'm presuming that the coordinates are accepted as x,y, although nowhere have I found that stated. I would prefer to KNOW something rather than HOW to accomplish something. Where within the icon's coordinate system

Leaflet polygon with fuzzy outline

半世苍凉 提交于 2020-01-01 03:39:05
问题 I am looking for a way to have a fuzzy/blur/gradient outline of a leaflet polygon. This should help make country outlines more simple (currently, when you zoom in to a svg representing a country, it gets ugly/inaccurate). I was thinking about attaching CSS attributes to the svg similiar to this: http://www.w3schools.com/svg/svg_fegaussianblur.asp But apparently the svg subelement <g> (used for the leaflet polygon) does not accept this. I also had a look at <defs> of svg (see here: http:/

React-Leaflet marker files not found

回眸只為那壹抹淺笑 提交于 2020-01-01 03:16:14
问题 I've got very simple code to display a map using react-leaflet and place a marker on it. However, i get the following two errors in my browser console GET http://localhost:8080/marker-icon-2x.png 404 (Not Found) GET http://localhost:8080/marker-shadow.png 404 (Not Found) I tried to fix this issue by downloading those two images and placing them at the root. It works. However, how can i change the URL the react-leaflet marker element looks for the marker images? I'd like to store them in ".

Clustering markers on mapbox / leaflet

这一生的挚爱 提交于 2020-01-01 03:05:06
问题 I'm trying to set up a clustered map on mapbox, like http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html But their example uses a plain .js file as data http://www.mapbox.com/mapbox.js/assets/realworld.388.js And the only thing I can get from mapbox is .geojson http://api.tiles.mapbox.com/v3/thebteam.map-w9jzcznw/markers.geojson Is there a way I can convert the geojson to js (on a regular basis)? Or export a javascript array from mapbox? EDIT: ended up

Mapbox Typescript

梦想的初衷 提交于 2020-01-01 03:04:33
问题 I managed to get Leaflet working with Angular 2 and Webpack by following this project. angular 2 leaflet starter I can see the typings configured in "browser.d.ts": /// <reference path="browser\ambient\leaflet\leaflet.d.ts" /> webpack.config.js defines an entry point: ... entry: { 'polyfills': './src/polyfills.ts', 'libs': './src/libs.ts', 'main': './src/main.ts' }, ... The "libs.ts" contains the import of the Leaflet module: import 'leaflet'; I'm using Atom as a code editor. It now

Projecting my shapefile data on leaflet map using R

拜拜、爱过 提交于 2019-12-31 10:38:13
问题 I (on Win7) was trying to get my shapefile data (Here are the data files.) to be displayed using leaflet package. But without any success. I only get the background map tile but not my data. I am able to see my data in QGIS though. I got the following code and description from here. library(rgdal) shapeData <- readOGR(".",'myGIS') ogrInfo(".",'myGIS') leaflet() %>% addTiles() %>% setView(lng = -106.363590, lat=31.968483,zoom=11) %>% addPolygons(data=shapeData,weight=5,col = 'red') %>%

Projecting my shapefile data on leaflet map using R

筅森魡賤 提交于 2019-12-31 10:37:44
问题 I (on Win7) was trying to get my shapefile data (Here are the data files.) to be displayed using leaflet package. But without any success. I only get the background map tile but not my data. I am able to see my data in QGIS though. I got the following code and description from here. library(rgdal) shapeData <- readOGR(".",'myGIS') ogrInfo(".",'myGIS') leaflet() %>% addTiles() %>% setView(lng = -106.363590, lat=31.968483,zoom=11) %>% addPolygons(data=shapeData,weight=5,col = 'red') %>%

How to trigger events on Leaflet map polygons?

与世无争的帅哥 提交于 2019-12-31 09:29:43
问题 I'm trying to figure out how to manually trigger events for Leaflet polygons (loaded via GeoJSON). In a nutshell, I have a Leaflet map with numerous polygons. I also have a regular hyperlink outside of the map that when clicked, should trigger a mouseover event (or any event really) on a particular polygon. How do I assign ID's to all of my polygons so that I can bind hyperlink(s) to a specific polygon's event? Or is that even the most logical way of doing this? Ultimately, I'm trying to

How to make offline maps(using leaflet OSM) , by caching?

不问归期 提交于 2019-12-31 08:46:10
问题 I am trying to make offline maps through caching (IndexedDB) in browser. I understand the concept is that I download and store the tiles of map first when connected to internet. Then I have to load the tiles logically offline. However, I'm not able to figure it out. How do I store them and how to load them again logically? I'm stuck here. I am using the leaflet API for maps. How can this be implemented? 回答1: See my extensive research on this at: Storing Image Data for offline web application

Using several Marker Cluster Groups displays overlapping Clusters

点点圈 提交于 2019-12-31 05:29:53
问题 I am using several L.markerClusterGroup({}) 's so that I can switch them in a Layers Control. But the Clusters hide behind each other. I would like to be able to get the total number of both Clusters. What am I missing? 回答1: The issue is that each Leaflet Marker Cluster Group (i.e. L.markerClusterGroup ) will perform its own clustering and render Clusters irrespective of what other Cluster Groups may display. Therefore if you have some individual Markers (or any point Features) that are in