leaflet

Position a marker direction in react-leaflet facing a [long, lat]

别等时光非礼了梦想. 提交于 2020-07-22 14:18:05
问题 I'm trying to add a marker on GeoJSON bezier curve which connects origin and destination points. The marker needs to be positioned facing destination. Here is the marker code: <Marker position={midPoint} key={origin}> <Tooltip permanent direction="center" sticky> <span> > </span> </Tooltip> </Marker> It would add markers at desired position But those little ">" would not point towards destination. Any solution for the above scenario? 回答1: One option to consider is utilize Leaflet

How to adjust the addPolylines function in shiny?

℡╲_俬逩灬. 提交于 2020-07-22 11:27:38
问题 Could you help me adjust the addPolylines on the second map ?? In the first it worked correctly, however in the second it did not show the red lines connecting one point to the other. I couldn't see what the error might be. I appreciate any help. I inserted an image below to illustrate. library(shiny) library(ggplot2) library(rdist) library(geosphere) library(shinythemes) library(leaflet) function.cl<-function(df,k,Filter1,Filter2){ #database df df<-structure(list(Properties = c(1,2,3,4,5,6,7

Shiny deployment error: upgrade GEOS to 3.6.0 or later while installing package ‘lwgeom’

余生颓废 提交于 2020-07-22 06:12:43
问题 I have a shiny app that runs fine on my computer. I use packages sf , leaflet , and tmap . One of these requires the package lwgeom as a dependency. While installing the package lwgeom , shiny deployment gives me the following error message. What is GEOS ? And how can I upgrade GEOS to 3.6.0 or later? Building R package: lwgeom (0.2-4) /mnt/packages/build /mnt * installing to library ‘/opt/R/4.0.0/lib/R/library’ * installing *source* package ‘lwgeom’ ... ** package ‘lwgeom’ successfully

How to setCenter() leaflet map in flutter

不问归期 提交于 2020-07-22 05:36:11
问题 I'm working on leaflet map in flutter. I built marker generator in order to make them move dynamically. I have a button to make the map center on my determined coordinate. This is the widget to create map. Widget _initMap(BuildContext context){ return Stack( children: <Widget>[ new FlutterMap( options: MapOptions( minZoom: _minzoom, maxZoom: _maxzoom, center: LatLng(mylatitude,mylongitude), ), layers: [ new TileLayerOptions( urlTemplate: 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',

Custom markers with different shapes and colors in leaflet R

走远了吗. 提交于 2020-07-18 08:22:20
问题 There are some examples to create custom markers in leaflet, but most of them are only for one variable. However, there are lots of data with several factors, which is better to visualize with different shapes and colors. Here is the dummy data, how to polt markers with different shapes and colors? lat1= 36+runif(n=5,min=-1,max=1) lon1 =-115+runif(n=5,min=-1,max=1) lat2= 35+runif(n=5,min=-0.5,max=0.5) lon2 =-110+runif(n=5,min=-0.5,max=0.5) lat3= 34+runif(n=5,min=-0.5,max=0.5) lon3 =-112+runif

Custom markers with different shapes and colors in leaflet R

馋奶兔 提交于 2020-07-18 08:21:56
问题 There are some examples to create custom markers in leaflet, but most of them are only for one variable. However, there are lots of data with several factors, which is better to visualize with different shapes and colors. Here is the dummy data, how to polt markers with different shapes and colors? lat1= 36+runif(n=5,min=-1,max=1) lon1 =-115+runif(n=5,min=-1,max=1) lat2= 35+runif(n=5,min=-0.5,max=0.5) lon2 =-110+runif(n=5,min=-0.5,max=0.5) lat3= 34+runif(n=5,min=-0.5,max=0.5) lon3 =-112+runif

Set Leaflet map to height: 100% of container

泄露秘密 提交于 2020-07-18 05:40:15
问题 Please how can we set the map div to be height: 100% of its container? I have tried this within a bootstrap template content section, but all I get is height of 0px. Even Google-Dev tools shows #map height as 0px. body { padding: 0; margin: 0; } html, body, #map { height: 100%; } 回答1: Set #map{ position: absolute; top: 0; bottom: 0; width: 100%; } and give its container position: relative . 回答2: The above answer didn't work for me, but this did: body { padding: 0; margin: 0; } html, body,

how to calculate area of polygon using Leaflet.Draw GeometryUtil

对着背影说爱祢 提交于 2020-07-10 08:09:07
问题 I read this answer on how to calculate the area of a polygon and I am trying to achieve the same. However, I consistently get 0 (zero) for the area. JS fiddle is here. The crux of my code is: var map = L.map('map').setView([19.04469, 72.9258], 12).addLayer(osm); var latlngs = [[19.04469, 72.9258], [19.07459, 72.9358], [19.08469, 72.4758]]; var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map); console.log('area is: '+L.GeometryUtil.geodesi I consistently get area is: 0 on the console.

Custom CRS: How to get the leaflet scale control to display mm (millimeter) and um (micrometer)

橙三吉。 提交于 2020-07-09 09:59:11
问题 Is there anyway to get leaflet to display values smaller than a meter? For instance, mm (millimeter), or um (micrometer) on the scale control? Or if there is a plugin that does this? I have a custom map with a custom CRS that uses virtual microscopy images. I use the following code to create a map with values less than a meter however the scale control is really wide and doesn't go below a meter: L.CRS.Meters = L.extend(L.CRS, { projection: L.extend( L.Projection.LonLat, { bounds: L.bounds([0

Disable popup window while using the measure tool in leaflet

蹲街弑〆低调 提交于 2020-07-09 05:25:10
问题 I am using a measure plugin tool in leaflet but when I try to measure between markers the pop up window interfers is there a way to fix this? I read something about oddclicks, I tried using that to no avail. $(".leaflet-control-measure").click(function() { var oddClick = $(this).data("oddClick"); $(this).data("oddClick", !oddClick); if (!oddClick) { map.off('click', popup); } else { map.on('click', popup); } }); popup logic- I am reading from a database, the popup is called from python in a