leaflet

change size of marker in leaflet

ぃ、小莉子 提交于 2020-06-11 18:09:30
问题 I have one marker on the map in leaflet: var centerMarker = L.marker(centerPoint, { title: 'unselected' }).bindLabel(schools[i][0]); centerMarker.on('click', selectMarker); centerMarker.addTo(map); I want to change the size of that marker on click. I know that we can change icons but I just want to change the size of the same icon of the marker. 回答1: You can get the old icon from the marker itself, change the size of the icon and then call setIcon with the changed icon: var icon =

time slider with leaflet/ R

若如初见. 提交于 2020-06-11 04:07:26
问题 I am currently working in R and I am using leaflet package to vizualize geospatial data, I would like to make an analysis over the time and display my map given a time slider In R there is the aesthetics function where it's possible to add slider with the frame option, is there a similar function with leaflet/ggmap or at least is it possible to facet the map given different year. I try to do the exercise with ggmap and ggplotly but this doesn't work as expected. Any exemple/ document or hint

time slider with leaflet/ R

China☆狼群 提交于 2020-06-11 04:07:12
问题 I am currently working in R and I am using leaflet package to vizualize geospatial data, I would like to make an analysis over the time and display my map given a time slider In R there is the aesthetics function where it's possible to add slider with the frame option, is there a similar function with leaflet/ggmap or at least is it possible to facet the map given different year. I try to do the exercise with ggmap and ggplotly but this doesn't work as expected. Any exemple/ document or hint

General function to insert the colors of the clusters in my map made by the leaflet package in R

不羁岁月 提交于 2020-06-07 05:58:25
问题 How I do a general function to insert the colors of the clusters? I used the leaflet package to generate the map. The way I did it was "if else", it worked, but if for example, I have 15 clusters, I will have many "if else". Can anybody help me ?? In addition, if possible I would like to put legend of the clusters on my map as well. My executable code is below: library(leaflet) library(geosphere) #database df<-structure(list(Properties = c(1,2,3,4,5,6,7,8,9,10), Latitude = c(-23.2, -23.6, -23

react leaflet updating markers

偶尔善良 提交于 2020-06-01 05:54:13
问题 hello I am a leaflet newbie, I am building my app with map component. the marker on the map should be updated every time the user perform specific action (filters) . the component was working fine . then I decided to add the responsive popup plugin from the original Leaflet. so I tweaked a lot the normal component of react leaflet . now every time I perform I new filters the new markers are added successfully to the map however the old marker are not deleted. codesandbox demo any help on how

react leaflet updating markers

随声附和 提交于 2020-06-01 05:54:06
问题 hello I am a leaflet newbie, I am building my app with map component. the marker on the map should be updated every time the user perform specific action (filters) . the component was working fine . then I decided to add the responsive popup plugin from the original Leaflet. so I tweaked a lot the normal component of react leaflet . now every time I perform I new filters the new markers are added successfully to the map however the old marker are not deleted. codesandbox demo any help on how

Update in real time tooltip with react-leaflet when changing language with i18n

假如想象 提交于 2020-06-01 05:43:06
问题 I am currently displaying a Map, thanks to react-leaflet, with a GeoJSON Component. I'm also displaying some tooltips on hover over some countries and cities(for example, when I hover France, a tooltip display "France"). I'm also using i18n for internationalization. The internationalization works fine for the country tooltips, they are updated in real time. I have a function updateDisplay , that switch between a GeoJson component for the countries, or a list of Marker for the cities, on zoom

Leaflet maps not working in R Studio after R 4.0.0 upgrade

核能气质少年 提交于 2020-05-28 07:17:01
问题 I updated my computer the other day (R, R Tools, and RStudio), and leaflet stopped working. When I run this example in the RGUI it's very slow, but eventually it opens a web page in a browser. When I run it in R Studio it's very slow, eventually the command finishes but nothing appears in the "view" tab, and R Studio keeps using more and more memory until I force kill it. library(leaflet) leaflet() %>% addTiles() %>% addMarkers(lng=174.768, lat=-36.852, popup="R") I've tried a few things with

Leaflet maps not working in R Studio after R 4.0.0 upgrade

帅比萌擦擦* 提交于 2020-05-28 07:14:48
问题 I updated my computer the other day (R, R Tools, and RStudio), and leaflet stopped working. When I run this example in the RGUI it's very slow, but eventually it opens a web page in a browser. When I run it in R Studio it's very slow, eventually the command finishes but nothing appears in the "view" tab, and R Studio keeps using more and more memory until I force kill it. library(leaflet) leaflet() %>% addTiles() %>% addMarkers(lng=174.768, lat=-36.852, popup="R") I've tried a few things with

SVG icons in Leaflet.js map

戏子无情 提交于 2020-05-27 04:56:30
问题 I have a working Leaflet map but cannot pass in SVG icons using encodeURI (have not tried encodeURIComponent because I'm not sure that is the issue). The gist I'm using shows how to pass in SVG rectangles and this works: <svg xmlns='http://www.w3.org/2000/svg'> <rect> x='0' y='0' width='20' height='10' fill='#000000' </rect> </svg> However, I cannot pass in a circle or a path successfully, even though the code is valid, optimized in SVGOMG, and appearing properly on SVG linters such as SVG