leaflet

show leaflet marker popup from outside of map dynamically

最后都变了- 提交于 2020-01-05 02:03:48
问题 I am using Leaflet javascript library to show some earthquake information. You are able to see few red circles on map. When you click that red circle it will display few details in popup. I want to show the popup when you click the link from outside of map. This (answer) is useful. But, I want to achieve it without ID? I mean if i have more than 30 markers on map and also I don't have any ID, just class names in my links. How do I trigger popup when I click a link from outside of map? This

show leaflet marker popup from outside of map dynamically

穿精又带淫゛_ 提交于 2020-01-05 02:02:09
问题 I am using Leaflet javascript library to show some earthquake information. You are able to see few red circles on map. When you click that red circle it will display few details in popup. I want to show the popup when you click the link from outside of map. This (answer) is useful. But, I want to achieve it without ID? I mean if i have more than 30 markers on map and also I don't have any ID, just class names in my links. How do I trigger popup when I click a link from outside of map? This

R Leaflet Legend: specify order instead of alphabetical

僤鯓⒐⒋嵵緔 提交于 2020-01-04 15:15:36
问题 I added legend to r leaflet code and output is this I would like the order to be GREEN "More than 66%" ORANGE "Between 33% and 66%" RED "Less than 33%" Code sep <- read.csv("31R_SEP_assets_csv - Copy.csv") Sub1 <- sep[grep("SEP.12", names(sep))] sep$newCol <- 100*rowSums(Sub1)/rowSums(sep[4:7]) # create a new grouping variable Percent_SEP12_Assets <- ifelse(sep[,8] <= 33, "Less than 33%", ifelse(sep[,8] >= 66, "More than 66%", "Between 33% and 66%")) Color_Assets <- colorFactor(c("darkgreen",

In Mapbox.js, how to smooth a polyline?

不打扰是莪最后的温柔 提交于 2020-01-04 13:26:39
问题 The code can be viewed at http://jsfiddle.net/qsr5bs6v/ Following are the lines to add a polyline L.polyline([[31.233, 121.465], [31.233499, 121.500634], [31.190172, 121.588107]], { color: '#000', smoothFactor: 10.0 }).addTo(map) As can be seen, there is an angle in the joint point of every two lines belonging to the polyline, like this, which is not so attractive: I was wondering whether there is an easy way to make the angle into a rounded curve in Mapbox.. (I saw this post about smoothing

Leaflet : ordering GeoJSON elements inside a layer

倖福魔咒の 提交于 2020-01-04 08:26:10
问题 I'm displaying a GeoJSON layer using leaflet, with the pointToLayer function. Everything works ok so far. But I would like to display my points in a certain order, based on a property of the GeoJSON. This is important because the radiuses of my points varies with this property, and I need to display the smaller circles on top. I hope I make myself clear. I've tried many things, but here's what I think is my best try : var pointLayer = L.geoJson(centroids, { pointToLayer: function (feature,

Coloring continuous data in leaflet, R does not work

情到浓时终转凉″ 提交于 2020-01-04 05:41:26
问题 Here is my data: t <- data.frame(Name=c('A','B','C','D','E','F','G','H','I','J'), Longitude=c(151.2008,151.2458,150.8217,151.1215,150.8906,151.0660,150.8889,150.9188,150.4364,150.9982), Latitude=c(-33.90772,-33.89250,-34.05951,-33.97856,-34.40470,-33.90010,-33.92832,-33.90761,-34.44651,-33.79232), Diff=c(0.03,0.10,0.12,0.04,-0.12,0.34,-0.14,-0.01,0.21,-0.02), Diff1=c(30,100,120,40,-120,340,-140,-10,210,-20)) I want to use leaflet and R to draw this points on the map, and use the values of

Change color of leaflet line accordingly with a vector

萝らか妹 提交于 2020-01-04 03:55:13
问题 Is there anyway to change the color of leaflet line base on the value of some variable? I google it, and found this link. However, I was wondering if there is a simple way to do it with leaflet in R. I tried something like: data <- data.frame(long = runif(40,-10,10), lat = runif(40,50,60), speed = runif(40,0,100)) leaflet(data) %>% addTiles() %>% addPolylines(lng = ~long, lat = ~lat, color = ~speed) but, it shows only one color. 来源: https://stackoverflow.com/questions/40948167/change-color-of

Leaflet GeoJSON points *behind* polygon

我是研究僧i 提交于 2020-01-04 02:17:10
问题 I have two leaflet geojson layers - they both have Point and Polygon features. I would like to be able to order them on the map, but when I do that today (attempting to order them by adding them in a certain order, using bringToBack/bringToFront, etc) the Point icons from both layers sit on top of all polygons. The reason (from my limited experience) appears to be that they're drawn on a completely different pane in the map. I'd very much like to have the points from a layer drawn on the same

leafletjs adding scrollable pop up?

試著忘記壹切 提交于 2020-01-04 02:04:24
问题 Using leafletjs with popups. When I have popups with minimal text all works fine. If I make them bigger they still work fine. If I add too much I add maxHeight to the pop up and it makes the pop up scrollable. If I start with out enough content to fill the page and make it scrollable, it is not made scrollable. That is Ok till I dynamically add more content to the popup and then I need the scroll bar but it will not show up. Any thoughts on how to get leafletjs to add the scroll bar to a

Proj4Leaflet reprojection like in openlayers

梦想的初衷 提交于 2020-01-03 19:06:38
问题 I try to display several layers in own projections on base map also in it's own projection Below my working example implemented using OpenLayers + proj4 library var projection_name = 'EPSG:32610'; proj4.defs(projection_name, "+proj=utm +zone=10 +datum=WGS84 +units=m +no_defs"); var proj = ol.proj.get(projection_name); var my_custom_layer = new ol.layer.Tile({ opacity: 0.5, source: new ol.source.XYZ({ url: '', projection: proj, }) }); var osm_layer = new ol.layer.Tile({ source: new ol.source