leaflet

Cannot move map in webview

随声附和 提交于 2019-12-31 05:25:13
问题 One activity (MainActivity) calls a fragment(MainPage). The fragment is designed to open a local asset webview file, Map.html. It works as intended, with the exception that the map cannot be moved by fingertip. This function is available when the Map.html is opened a broswer. However, the zoom in zoom out tap button in the top left does work. Is something overlaying the webview such that it can be seen but not swiped? The initial AppCompatActivity (to support ActionBar) is given by

R leaflet is drawing base layers on top of overlay layers

别等时光非礼了梦想. 提交于 2019-12-31 05:23:09
问题 I'm running into a problem with leaflet for R: When I change the base layer (polygons), the overlay layer gets pushed behind the base layer. From my reading of the leafletR help files, the overlay layers should always have a higher z-index than the base layers, and should stay on top. Example is here: http://rpubs.com/bvila/overdraw require(acs) require(tigris) require(leaflet) require(tidyverse) leaflet(data = counties(state = "UT")) %>% addPolygons(color = "red", fillColor = "orange", group

Render custom tiles in R leaflet from local directory (i.e. not from a git repository)

不羁岁月 提交于 2019-12-31 03:18:05
问题 I have created some tiles out of a very large raster using the Qtiles plugin in Qgis. I have saved them to a local directory on my computer, and now want to render them in a leaflet map using R. The addTiles function passes a URL, but doesn't seem to work with a local filepath. In a different post (How to render custom map tiles created with gdal2tiles in Leaflet for R?), Lauren recommends using a www folder inside the shiny directory. Firstly, I'm not 100% sure what is meant by that, and

how to catch the click event on a leaflet popup

怎甘沉沦 提交于 2019-12-31 02:54:45
问题 I'm having multiple popups on a leaflet map open at the same time, and they can overlap. I want to bring a popup to front if clicked on. While I have no trouble getting the click on the map with map.on('click', function(e) {do something;}); I can't seem to do the same thing with a popup. How can i catch the click event on a L.Popup? 回答1: The setContent method of L.Popup accepts HTML elements so you could do something like this: var content = L.DomUtil.create('div', 'content'), popup = L.popup

how to catch the click event on a leaflet popup

梦想与她 提交于 2019-12-31 02:54:24
问题 I'm having multiple popups on a leaflet map open at the same time, and they can overlap. I want to bring a popup to front if clicked on. While I have no trouble getting the click on the map with map.on('click', function(e) {do something;}); I can't seem to do the same thing with a popup. How can i catch the click event on a L.Popup? 回答1: The setContent method of L.Popup accepts HTML elements so you could do something like this: var content = L.DomUtil.create('div', 'content'), popup = L.popup

Cluster multiple Layers with markercluster

a 夏天 提交于 2019-12-30 19:59:46
问题 I am currently working on a map visualization with the Leaflet library. I am also using the markercluster plugin to cluster my points. So my question now is the following: I have 3 different categories of Markers in 3 different layers. For example Restaurants, Cafes and Bars Layers. And I want to combine all active Layers to a specific cluster. At the moment the entries are clustered separately but I want to cluster them together. The next step would be coloring the cluster according to the

Manually adding legend values in leaflet

眉间皱痕 提交于 2019-12-30 10:19:12
问题 I'm plotting results from various British elections in Leaflet and ran into a bit of a problem with legends. For the various results in the general election I'm using the same colour function with different domain for the different data (the yellow-> purple scale in the picture) This is created with (for the first two as examples): labvotescols <- colorNumeric( c("Yellow", "Purple"), domain = Westminster$LabourVotes, ukipvotescols <- colorNumeric( c("Yellow", "Purple"), domain = Westminster

clearShapes() not working — leaflet() for R

泪湿孤枕 提交于 2019-12-30 10:07:25
问题 I cannot figure out why clearshapes() is not working in my leaflet shiny program. I am trying to remove the existing circles and replace with a category that is selected based on the input check box that I have. However, what happens is that new circles are overlayed on top of the existing ones. Anyone encounter this before? df = read.csv("mappingData.csv",header=T, sep =",") ui = fluidPage( checkboxGroupInput("set", label = "Pothole Reported by:", choices = list("Citizens Connect App" =

Explanation of Leaflet Custom Icon LatLng vs XY Coordinates

夙愿已清 提交于 2019-12-30 07:09:09
问题 Can someone provide an explanation on how to use the Leaflet Marker Icon XY Coordinates listed here: http://leafletjs.com/examples/custom-icons/ Is lng/lat directly mapped to x/y? For example, sometimes in game engines, the Y pixel increases in value, but goes down the page. Here is it the same? I can't quite wrap my head around it. 回答1: Not exactly sure what you mean by " Is lng/lat directly mapped to x/y? ", but here are some explanations that should talk enough: (tile courtesy MapQuest) As

How can I get a leaflet.js instance using only a DOM object?

好久不见. 提交于 2019-12-30 06:35:49
问题 I'm right now building a custom Knockout.js binding to handle drawing of polygons. In this case the Knockout API only gives me a reference to a DOM object to access whatever it is I need to update. However, it looks like by design leaflet.js wants the user to store the map instance in their implementation. I don't have that option. Trying this gave me an error: var existingMap = L.map('aMapIDGoesHere') And the error was: map already initialized . Any way I can use a DOM element or element ID