leaflet

R Leaflet (CRAN) - how to register clicking off a marker

我们两清 提交于 2020-01-11 06:07:08
问题 Using the RStudio Leaflet package in a shiny app I've been able to achieve all the functionality I've looked for except deselecting a marker object once it has been clicked on. More specifically, the input$map_click_id value is set to NULL before any markers are clicked. Upon clicking a marker it is updated with the data (ID, lat, lng, nonce) for that marker. I would like to set the map up so that when a user clicks on any area of the map which is not a marker, input$map_click_id is reset to

rotate polygon around point in leaflet map

…衆ロ難τιáo~ 提交于 2020-01-11 04:12:06
问题 I have an issue, in my leaflet map I've created a triangle from polygon: var polygon = L.polygon([ [parseFloat(decimal_lat),parseFloat(decimal_lon)], [parseFloat(decimal_lat) + 1, parseFloat(decimal_lon) - 1], [parseFloat(decimal_lat) + 1, parseFloat(decimal_lon) + 1] ], { color:'green' }); polygon.addTo(map); and I want to rotate this polygon around Point[decimal_lon, decimal_lat] . But I'm not able to solve it.. I've created DEMO, where I'm rotating polynom the same I want to rotate my

Creating Leaflet heatmaps in r and shiny using rCharts

橙三吉。 提交于 2020-01-10 15:39:59
问题 I am using the great demo by Ramnath Vaidyanathan at http://rmaps.github.io/blog/posts/leaflet-heat-maps/index.html and I would like to reproduce his heat map for my shiny application. When I try to use Ramnath's code in shiny though I only manage to get the map out, but not the heat map. Possibly part of the reason of my problems is that the original code from Ramnath uses rMaps while I'm using rCharts (also developed by Ramnath) as it is more developed / better integrated with shiny and of

Creating Leaflet heatmaps in r and shiny using rCharts

夙愿已清 提交于 2020-01-10 15:39:07
问题 I am using the great demo by Ramnath Vaidyanathan at http://rmaps.github.io/blog/posts/leaflet-heat-maps/index.html and I would like to reproduce his heat map for my shiny application. When I try to use Ramnath's code in shiny though I only manage to get the map out, but not the heat map. Possibly part of the reason of my problems is that the original code from Ramnath uses rMaps while I'm using rCharts (also developed by Ramnath) as it is more developed / better integrated with shiny and of

Using PouchDB as an offline raster map cache

点点圈 提交于 2020-01-10 09:21:38
问题 I have been exploring using PouchDB as an offline cache for raster map tiles. Specifically, for Leaflet. I have just finished some preliminary tests which I thought I would share. 回答1: I have created a "JsFiddle" (actually I prefer CodePen these days), as a playground for showing how to use PouchDB to cache off-line raster map tiles. http://codepen.io/DrYSG/pen/hpqoD The Algorithm it uses is as follows: Test for presence of XHR2, IndexedDB, and Chrome (which does not have binary blobs, but

How to save a leaflet map with drawn shapes/points on it in Shiny?

我的梦境 提交于 2020-01-10 01:43:12
问题 This question is a follow-up to the questions How to save a leaflet map in Shiny, and Save leaflet map in Shiny. I add a toolbar to draw shapes/points on the map that is addDrawToolbar in the leaflet.extras package. That lets users to draw lines, shapes, ... interactively. In the end I want one to be able to save the map with the drawn shapes as a pdf or png. I have coded up the following making use of the answer to the question: How to save a leaflet map in Shiny. But it does not help

Leaflet plugin only working when geolocation is enabled

徘徊边缘 提交于 2020-01-07 06:59:06
问题 I am using leaflet with react-leaflet. OverpassLayer is working when geolocation is enabled. When Geolocation is blocked because I'm on localhost, the app isn't even entering the OverpassLayer component. App.js import OverpassLayer from './OverpassLayer' class App extends React.Component { state = { zoom: 16, position: { lat: 51.505, lng: -0.09, }, mapKey: Math.random(), overpassLayerKey: Math.random() } componentDidMount () { //center map on user's current position this.handleGeolocation()

Mapbox and Leaflet Draw edit only 1 group

ⅰ亾dé卋堺 提交于 2020-01-07 06:56:14
问题 I want to add multiple layergroup or featuregroup objects or something else if there's a better way on a map that can contain multiple polygons in each. I want these groups to be distinguishable so they can be used in conjunction with datatables and the leaflet draw tool so that when I select a row within datatables, only the polygons within the related group can be edited or deleted using the draw tool and any new polygons are only added to that group. I've done this before with only a

Leaflet :: Changing icon based on zoom level [closed]

怎甘沉沦 提交于 2020-01-07 06:43:10
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago . How do I go about changing an icon height & width based on Leaflet zoom level? I'm using Leaflet api v0.7.5 回答1: Use the L.Marker.setIcon method together with the map's zoomend event, i.e.: var marker = L.marker(…).addTo(map); var bigIcon = L.icon(…); var smallIcon = L.icon(…

how to add a gradient over a leaflet map?

随声附和 提交于 2020-01-07 03:31:01
问题 I'm trying to add a gradient over a leaflet map that will fade from white to transparent and partially obscure it. Using a regular gradient with CSS as a background makes the gradient appear only when the map is reloading. So I tried putting the gradient in the 'foreground' using the accepted answer from this question: Is there a foreground equivalent to background-image in css? This still doesn't work - the map is still sitting on top of it. Can anyone think of a way to do this? thanks.