leaflet

Project Leaflet LatLng to tile pixel coordinates

你说的曾经没有我的故事 提交于 2021-02-08 13:52:30
问题 For canvas layers, how can I access the clicked pixel of a specific tile? Given a LatLng like { lat: 37.68816, lng: -119.76196 } , how can I: #1, retrieve the correct tile clicked, and #2, the pixel coordinates within the tile? Both of these should consider maxNativeZoom . 回答1: A CRS like L.CRS.EPSG3857 is required. The map's CRS is accessible by map.options.crs . The true zoom, tile size (like 256, but could be 512 or higher about maxNativeZoom ) and a pixel origin like map.getPixelOrigin()

integrating leaflet map in RShiny - inputselect by country and symptom

微笑、不失礼 提交于 2021-02-08 11:56:21
问题 I am attempting to create a map within Shiny R, with leaflet. I have several questions: How to create the map by selecting Symptoms by Country? as you can see data contains countries and symptoms in rows (see link on GitHub provided bellow). if I want to filter by a certain country and certain symptom how do I do this with leaflet in Shiny r? I want created a draggable drop down menu (where symptoms can be chosen - see question 1) since I cannot adjust the map on the entire screen. An example

setting the zoom level to 7.25 in shiny leaflet r

喜欢而已 提交于 2021-02-08 11:08:39
问题 Using leaflet function within the shiny context, I have been able to create a great interactive map. I would like to set the zoom to somewhere between 7 and 7.5 (e.g., 7.25). I tried to do so as is shown in the code below but the zoom level in the map remained unchanged. It appears that one can set the zoom level to either 7 or 7.5 not anything between these numbers. How can fix this? Thanks. setView(-82.706838, 40.358615, zoom=7.25) 回答1: Use leaflet map options: zoomSnap: how small you can

setting the zoom level to 7.25 in shiny leaflet r

℡╲_俬逩灬. 提交于 2021-02-08 11:07:01
问题 Using leaflet function within the shiny context, I have been able to create a great interactive map. I would like to set the zoom to somewhere between 7 and 7.5 (e.g., 7.25). I tried to do so as is shown in the code below but the zoom level in the map remained unchanged. It appears that one can set the zoom level to either 7 or 7.5 not anything between these numbers. How can fix this? Thanks. setView(-82.706838, 40.358615, zoom=7.25) 回答1: Use leaflet map options: zoomSnap: how small you can

Uncaught TypeError: Cannot read property '0' of null - leaflet

若如初见. 提交于 2021-02-08 10:35:16
问题 I'm trying update my leaflet map via JS + AJAX, but leaflet return me an error Uncaught TypeError: Cannot read property '0' of null on leaflet.js:5 I have function, which get data from server, everything works, when I call function getData , I get data and function printRoute writes data to "test" element, but L.polyline([... still returns error. Data ( output of xhttp.responseText ) are in right format, which L.polyline needs ( [ 49.999319, 13.897081 ], [ 49.997681, 13.905933 ], ... , [ 49

What is the good way to create custom GeoJSON component

◇◆丶佛笑我妖孽 提交于 2021-02-08 10:01:31
问题 I Need help to create GeoJSON custom component from React-Leaflet Write with React and React-Leaflet (last version both) The code works when write in the Map component, but I want to import/export it to split code import React from 'react'; import { withLeaflet, GeoJSON } from 'react-leaflet' import L from 'leaflet' class CustomGesJSON extends GeoJSON { getStyle(feature) { // some code } pointToLayer(feature, latlng) { // some code } onEachFeature(feature, layer) { // some code }

How to draw path superposition with different color on leaflet.js?

天大地大妈咪最大 提交于 2021-02-08 05:43:21
问题 I would like to draw several paths from same coordinates on a leaflet.js map. I have thought about making the gap between paths with trigonometric computations, but it's too complex to deal with teh zoom level, translate GPS coordinates to a vector, etc. The drawing I have now is like this (another path is under the green path): And I would like something like that: Of course, the coordinates, angle and zoomlevel can change. 回答1: You would probably be interested in Leaflet Polyline Offset

Filter reactive data with button clicked on leaflet map popup

落花浮王杯 提交于 2021-02-08 03:50:16
问题 I have a shiny app that displays information to users. Each line represents a place, so you can use two selectInputs to filter data using specific city names and areas. I'm using reactive() to filter the data. The resulting data is displayed below with info boxes and a map showing the location of each place. The info boxes have an action button that, once clicked, displays only the marker corresponding to the box. I'm updating my map with leafletProxy . Also, in my map, I have makers with

Filter reactive data with button clicked on leaflet map popup

醉酒当歌 提交于 2021-02-08 03:49:39
问题 I have a shiny app that displays information to users. Each line represents a place, so you can use two selectInputs to filter data using specific city names and areas. I'm using reactive() to filter the data. The resulting data is displayed below with info boxes and a map showing the location of each place. The info boxes have an action button that, once clicked, displays only the marker corresponding to the box. I'm updating my map with leafletProxy . Also, in my map, I have makers with

Filter reactive data with button clicked on leaflet map popup

瘦欲@ 提交于 2021-02-08 03:48:13
问题 I have a shiny app that displays information to users. Each line represents a place, so you can use two selectInputs to filter data using specific city names and areas. I'm using reactive() to filter the data. The resulting data is displayed below with info boxes and a map showing the location of each place. The info boxes have an action button that, once clicked, displays only the marker corresponding to the box. I'm updating my map with leafletProxy . Also, in my map, I have makers with