leaflet

leaflet loads incomplete map

会有一股神秘感。 提交于 2021-02-07 20:20:54
问题 I am dynamically adding a leaflet map to a div. The map is only shown partially, see picture. Once I resize the browser window the map is completely shown. Is there a way around this? I tried some initial ideas, see // in code. But none of them worked.incomplete map function mapThis(lat,long,wikiTitle){ var div_Id= "#wikiExtract"+wikiTitle var map_Id= "map"+wikiTitle $(div_Id).append("<div id='"+map_Id+"' style='width: 600px; height: 400px'></div>"); var map = L.map(map_Id).setView([lat, long

Set tooltip on custom leafletjs control

荒凉一梦 提交于 2021-02-07 14:15:55
问题 I have made several custom buttons in Leafletjs - now I would like to add a hover-over tooltip to explain what the button does. I've tried putting a "title:" and "tooltip:" in the options but still do not see the text when I hover over the control. var load = L.Control.extend({ options: { position: 'topright' }, onAdd: function(map) { var container = L.DomUtil.create('div', 'leaflet-bar leaflet-control leaflet-control-load-points'); //container.style.backgroundColor = 'white'; container.style

Changing marker clustering by zoom level in Shiny / Leaflet / R

北城余情 提交于 2021-02-07 12:55:01
问题 I want to create a web application where a user inputs a set of identifiers, and a set of dots on a map related to those identifiers appear. Trouble is, this data can number in the tens to hundreds of thousands to even potentially millions. Given this possibility, I want to take a light tack. Below is my ideal aggregation behavior. At low zoom levels, I want to aggregate these dots into counts by state (appropriate symbology size/color indicating higher intensity, with the dot centered on the

Use custom icons with canvas rendering leaflet

﹥>﹥吖頭↗ 提交于 2021-02-07 11:49:40
问题 I need to draw thousands of points on a leaflet map with custom icons. The performance using the standard L.marker is too slow to be usable when I get to around 1500 markers. I attempted the solution here using L.circleMarker, and I am able to draw thousands of points with stellar performance. Unforunately, with using L.circleMarker I am only able to make different kinds of circles, which does not satisfy my requirements. I am also not able to leverage clustering, since there isn't a

Python with Folium: How can I embed a webpage in the popup?

烈酒焚心 提交于 2021-02-07 04:00:53
问题 I'm working on a simple implementation of Python Folium with simple markers based on this page. import folium map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12, tiles='Stamen Terrain') map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows') map_1.simple_marker([45.3311, -121.7113], popup='Timberline Lodge') map_1.create_map(path='mthood.html') I can include HTML in the popup, but I'd like to embed a webpage. Here is my mock-up. Is it possible? 回答1: Here a quick

Python with Folium: How can I embed a webpage in the popup?

走远了吗. 提交于 2021-02-07 04:00:50
问题 I'm working on a simple implementation of Python Folium with simple markers based on this page. import folium map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12, tiles='Stamen Terrain') map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows') map_1.simple_marker([45.3311, -121.7113], popup='Timberline Lodge') map_1.create_map(path='mthood.html') I can include HTML in the popup, but I'd like to embed a webpage. Here is my mock-up. Is it possible? 回答1: Here a quick

Python with Folium: How can I embed a webpage in the popup?

只谈情不闲聊 提交于 2021-02-07 04:00:19
问题 I'm working on a simple implementation of Python Folium with simple markers based on this page. import folium map_1 = folium.Map(location=[45.372, -121.6972], zoom_start=12, tiles='Stamen Terrain') map_1.simple_marker([45.3288, -121.6625], popup='Mt. Hood Meadows') map_1.simple_marker([45.3311, -121.7113], popup='Timberline Lodge') map_1.create_map(path='mthood.html') I can include HTML in the popup, but I'd like to embed a webpage. Here is my mock-up. Is it possible? 回答1: Here a quick

Select multiple items using map_click in leaflet, linked to selectizeInput() in shiny app (R)

一世执手 提交于 2021-02-07 03:46:37
问题 I would like to create a leaflet map where you can select multiple polygons and this will update the selectizeInput() in a shiny app. This would including removing a selected polygon, when it is removed in the selectizeInput() . I have slightly changed/updated the code from the answer here (use of sf instead of sp and more dplyr where I could work out what the base R was). The polygons could probably be updated with an observeEvent tied in with input$clicked_locations , but not sure exactly

Select multiple items using map_click in leaflet, linked to selectizeInput() in shiny app (R)

喜夏-厌秋 提交于 2021-02-07 03:45:23
问题 I would like to create a leaflet map where you can select multiple polygons and this will update the selectizeInput() in a shiny app. This would including removing a selected polygon, when it is removed in the selectizeInput() . I have slightly changed/updated the code from the answer here (use of sf instead of sp and more dplyr where I could work out what the base R was). The polygons could probably be updated with an observeEvent tied in with input$clicked_locations , but not sure exactly

Get coordinates from a drawing object from an R leaflet map

此生再无相见时 提交于 2021-02-07 03:38:42
问题 I am building a shiny app where I would like to get the coordinates of a polygon from a leaflet map. Specifically, the shape is drawn using the Drawtoolbar from the leaflet.extras package. A simple example app is below. My question is, how can I get the coordinates from the shape drawn on the map by the user? Thank you in advance. library(shiny) library(leaflet) library(leaflet.extras) # Define UI ui <- fluidPage( leafletOutput("mymap",height=800) ) # Define server logic server <- function