leaflet

Proj4Leaflet reprojection like in openlayers

孤者浪人 提交于 2020-01-03 19:06:17
问题 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

adding leaflet marker to d3.js map

社会主义新天地 提交于 2020-01-03 17:16:15
问题 I tried adding leaflet marker to d3'js map.Unfortunately the marker doesn't show. Is it possible to mix these two scripts? Here's my code: <!DOCTYPE html> <meta charset="utf-8"> <link type="text/css" rel="stylesheet" href="d3map.css" /> <link rel="stylesheet" href="leaflet.css"/> <script src="leaflet.js"></script> <script src="http://d3js.org/d3.v3.min.js"></script> <script src="//d3js.org/d3.geo.projection.v0.min.js"></script> <script src="//d3js.org/topojson.v1.min.js"></script> <script src

Mapbox Marker Symbol with Three Digits

萝らか妹 提交于 2020-01-03 15:51:28
问题 I'm trying to label the standard Mapbox markers with two- and three-digit ids using 'marker-symbol'. The two-digit markers work well, as seen below, but when I try to include three digits, i.e. 112, the markers do not display on the map. Is there an easy way to do this with the built-in marker and not creating a custom div marker? 回答1: Sorry to say, there is no easy way to do this. Not with the built-in marker. Those markers are just images which get loaded from the Mapbox server. They exist

Leaflet.js: is it possible to filter geoJSON features by property?

夙愿已清 提交于 2020-01-03 13:31:07
问题 I'm looking around and I see a lot of information about how to show/hide layers. That's cool, but since I can add arbitrary properties to geoJSON features I kind of expect to be able to filter them accordingly. For instance if I have features 1, 2 & 3 with these properties small | red | sweet large | green | sour small | red | hot How would I filter them by size? Or by color or flavor? 回答1: http://leafletjs.com/examples/geojson.html Yes you can, just add a filter function like: L.geoJson

How can I fix bootstrap leaflet map mobile display?

人盡茶涼 提交于 2020-01-03 05:34:10
问题 I'm using bootstrap to set up a leaflet map. Works great on browsers so far, but does not display at all on a mobile. Tried the invalidateSize(); work around to no avail (Leaflet map not displayed properly inside tabbed panel) See code below. <body> <div class="navbar navbar-inverse navbar-fixed-top" role="navigation"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span class="icon-bar"></span></button> <a class=

Add existing leaflet polygons to an existing leaflet layer

风流意气都作罢 提交于 2020-01-03 04:28:19
问题 I have a bunch of polygons which are stored in a database. I would like to add them to the map in such a way that they can be edited using the leaflet-draw toolbar. Although, now the polygons get added to the map, I am unable edit them. I think this is because they are not added to the layerGroup() to which newly drawn shapes are added. Please help. 回答1: You have to add your polygons to the featureGroup drawnItems ! Let's say, var polyLayers = dbArray; is your database array with polygons.

Leaflet: Grouped layers and accordion menu - How to implement?

我与影子孤独终老i 提交于 2020-01-03 02:02:06
问题 I have a single geojson featurecollection. Each feature has a Subcategory property and a main Category property (ex. "Subcategory": "Brown regional airport", "Category": "Aviation") I was able to group the subcategories into a main category by using the Leaflet.groupedlayercontrol Leaflet plugin. Here's a live example: [ demo link ] The problem is that in my real case scenario, I have a lot of categories and subcategories and this is way too many layers to show at once in the layer control.

Define function in leaflet cluster options

拜拜、爱过 提交于 2020-01-02 15:26:50
问题 How do I custom the cluster options so that the markers aren't clustered by the default Leaflet markerOptions(count of markers), but by a function (mean, maximum or whatelse) that I choose? For Java i could find tons of examples, but for R I couldn't find anything. Only thing I could find is something that has to do with "iconCreateFunction" and "JS()", but I don't know if it's right and how it works.. leaflet(data) %>% addTiles() %>% addMarkers(lng=data$lon, lat=data$lat, clusterOptions =

R Shiny leaflet addPolygons (colors are not showing)

萝らか妹 提交于 2020-01-02 09:53:55
问题 I hope you can help me. I have created a choropleth Map with Leaflet. I merged my (dataframe with countries and a random score) and a Shapefile with the Polygon data. So far it is working, however if I implement it in R-Shiny, the map is showing, but with no color. There is also no error showing. Anyone knows why? My code: ui <- fluidPage( leafletOutput("map") ) shinyServer(function(input, output) { output$map <- renderLeaflet({ test_map }) }) global.R tmp <- tempdir() url <- "http://www

R Shiny leaflet addPolygons (colors are not showing)

混江龙づ霸主 提交于 2020-01-02 09:53:18
问题 I hope you can help me. I have created a choropleth Map with Leaflet. I merged my (dataframe with countries and a random score) and a Shapefile with the Polygon data. So far it is working, however if I implement it in R-Shiny, the map is showing, but with no color. There is also no error showing. Anyone knows why? My code: ui <- fluidPage( leafletOutput("map") ) shinyServer(function(input, output) { output$map <- renderLeaflet({ test_map }) }) global.R tmp <- tempdir() url <- "http://www