leaflet

Leaflet slider group by year

六眼飞鱼酱① 提交于 2020-01-02 07:25:33
问题 I'm using leaflet slider - https://github.com/dwilhelm89/LeafletSlider - but I can't get the desired result, even if from the plugin description it seems it can do. I have a collection of features, geometry type is polygon, where I've inserted a property "time" as requested by the plugin. I've tried bot with "time":"2014" and "time":"2014-01-01 00:00:00" with no difference. I have in total 30 features, 10 for 2012, 10 for 2013 and 10 for 2014 What I'm trying to achieve is to show all the

Why is webshot not working with leaflets in R shiny?

北战南征 提交于 2020-01-02 04:48:08
问题 First off webshot isn't working in this context webshot("google.com") for webshot("www.google.com") I get : env: node\r: No such file or directory Error in webshot("google.com") : webshot.js returned failure value: 127 so This isn't working for the leaftlet code staters <<- readOGR(dsn="cb_2015_us_county_20m",layer="cb_2015_us_county_20m") getMap<-function()({ leaflet(staters) %>% addPolygons( stroke = T, fillOpacity =.7, smoothFactor = 0, color = "black", weight = .5, fill = T, fillColor =

Shiny/Leaflet map not rendering

守給你的承諾、 提交于 2020-01-02 04:05:31
问题 I can't get a leaflet map to render in my shiny app, although the code works by itself outside of shiny. I do not get any errors so I am stuck, any help is appreciated. Sample Data: cleanbuffalo <- data.frame(name = c("queen","toni","pepper"), longitude = c(31.8,32,33), latitude = c(-24,-25,-26)) Shiny UI: vars <- c( "Pepper" = "pepper", "Queen" = "queen", "Toni" = "toni" ) shinyUI(navbarPage("Buffalo Migration", id ="nav", tabPanel("Interactive Map", div(class="outer", leafletOutput("map",

SVG circles don't get repositioned when zooming leaflet map

扶醉桌前 提交于 2020-01-02 03:27:08
问题 I'm using d3 to add svg circles on leaflet map. My fiddle is here http://jsfiddle.net/nextstopsun/C3U8g/ I've added a reset() function to map viewreset event to calculate transformation for svg g element containing all circles. This function is called on map viewreset event. svg.attr("width", topRight[0] - bottomLeft[0]) .attr("height", bottomLeft[1] - topRight[1]) .style("margin-left", bottomLeft[0] + "px") .style("margin-top", topRight[1] + "px"); g.attr("transform", "translate(" +

identify which is the polygon from latitude and longitude

大憨熊 提交于 2020-01-02 03:12:10
问题 I have a map drawn using leaflet.js. If I give longitude and latitude value as input Can I identify the polygon? Can I get a client side script for this? 回答1: Got an answer as follows : //This is based on 'point in polygon algorithm' function getPoint () { float x=-89.82421875; //x and y represents the lat and lng values float y= 40.18307014852533; var a = boundaries; //the coordinates used to draw the map for (i = 0; i < a.features.length; i++) { PointInPolygon(x,y, a.features[i].geometry

Removing all data/markers in Leaflet map before calling another JSON

梦想与她 提交于 2020-01-02 02:18:22
问题 I'm retrieving different data to mark leaflet map using different JSON files. Each radio button retrieves a different JSON file. However, I'm having trouble clearing the markers when I select different radio button. All the markers just adds up from one JSON file to another. I want to be able to clear all the markers when I select a different radio button. I searched around and read that map.removeLayer(MyLayer); will remove all markers. So I created an array of markers called "markers" and

Incorporate Leaflet map in revealjs presentation within R

坚强是说给别人听的谎言 提交于 2020-01-01 09:54:38
问题 I'm trying to add a Leaflet map with tiles to a revealjs_presentation created in R. This map renders fine in ioslide or html format, but not in the revealjs_presentation format (main problems: all fonts are much too large and the map has strange artifacts around polygon boundaries when selected). Because the map works well in other output formats I suspect the issue has to do with some kind of CSS incompatability between revealjs_presentation and leaflet. In order to isolate the two sets of

Incorporate Leaflet map in revealjs presentation within R

大城市里の小女人 提交于 2020-01-01 09:51:14
问题 I'm trying to add a Leaflet map with tiles to a revealjs_presentation created in R. This map renders fine in ioslide or html format, but not in the revealjs_presentation format (main problems: all fonts are much too large and the map has strange artifacts around polygon boundaries when selected). Because the map works well in other output formats I suspect the issue has to do with some kind of CSS incompatability between revealjs_presentation and leaflet. In order to isolate the two sets of

Clear all polylines from leaflet map

烂漫一生 提交于 2020-01-01 08:35:58
问题 I am struggling to clear all polylines from my map, i only clear the newest. var polylines; // add map polylines function addPolyline(polyArray, colour) { polylines = L.polyline(polyArray, {color: colour}); polylines.addTo(map); } // clear polylines function clearPolylines() { map.removeLayer(polylines); } where addPolylines is called multiple times and clear Polylines is called once. How can i clear all polylines on the map? 回答1: You'll have to remember them all or cheat a bit and peek into

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

▼魔方 西西 提交于 2020-01-01 05:03:46
问题 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