maps

Leaflet.js - Draw polyline to nearest point from a location

故事扮演 提交于 2019-12-21 02:43:26
问题 I need to draw a polyline between two points using the shortest distance. Example, my location is New York, I have a location in China and I want to draw a polyline connecting the two locations. Where I am - see fiddle here: http://jsfiddle.net/Vsq4D/1/ The problem is that when I draw the line it does use the shortest distance. In the above example it draws from the US to China with the line going to the right, the longest way round the Earth, not the left, which is the shortest way. What am

IPhone : google maps directions

风格不统一 提交于 2019-12-21 02:39:11
问题 i'm developing an iPhone app which embed a mapView made with mkmapkit. I got two coordinates and I'm tracing the direction between these two points. Everything works well. I'm using google maps api : maps.googleapis.com/maps/api/directions to retrieve xml with all the steps of the direction. But one thing is very strange : I just can't understand why driving direction is not accurate. Between two steps it trace a right line and don't follow the road while walking travel mode trace a very

Getting map zoom level for given bounds on Android like on JS Google Maps API: map.getBoundsZoomLevel(bounds)

混江龙づ霸主 提交于 2019-12-21 02:27:06
问题 I have a cluster marker that defines a bounding rectangle containing a group of markers. The cluster has a center (lat,lon), a marker count and a latitude and longitude span to calculate the bounds. The Google Maps API (JS) has a function called "getBoundsZoomLevel(bounds)" but I cannot find an equivalent method in the Google Maps SDK for Android. How can I estimate the zoom level for given bounds (especially on different devices with different resolutions/densitys)? I've planned that an user

Use Rcartogram on a SpatialPolygonsDataFrame object

浪子不回头ぞ 提交于 2019-12-21 00:31:52
问题 I'm trying to do the same thing asked in this question, Cartogram + choropleth map in R, but starting from a SpatialPolygonsDataFrame and hoping to end up with the same type of object. I could save the object as a shapefile, use scapetoad, reopen it and convert back, but I'd rather have it all within R so that the procedure is fully reproducible, and so that I can code dozens of variations automatically. I've forked the Rcartogram code on github and added my efforts so far here. Essentially

Why my map app crashes if I set maxSdkVersion in the WRITE_EXTERNAL_STORAGE permission?

主宰稳场 提交于 2019-12-20 15:10:43
问题 I've set my map following the instructions in this link. And set the WRITE_EXTERNAL_STORAGE permission in accordance with the recomended by the Official Android Documentation, that is request this permission only for API level 18 and lower. So, I have this manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp" > <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"

Google maps GeoJSON- toggle marker layers?

余生长醉 提交于 2019-12-20 10:48:25
问题 I have some GeoJSON returned from a call to a PostGIS database. I'd like to be able to add a marker for each feature, and be able to toggle different types of marker/feature. Currently I'm using JavaScript to generate a marker for each feature, adding them to arrays according to type, and then going through the arrays setting show/hide as appropriate to toggle the 'layers'. This works OK, but I'm wondering if the new GeoJSON functionality offers a better way to do this. As far as I can see

Determine user location on osm maps

时光总嘲笑我的痴心妄想 提交于 2019-12-20 09:55:49
问题 I am working on an android application that determines user location in osm maps. I am being able to show user location on the map, but if the location change the whole map is reloaded, what’s wrong with that? Also how I can increase the accuracy of the user location? And how can I make a circle that increase and decrease according to the accuracy(as shown in Google one)? code : public class OsmDemoActivity extends Activity implements LocationListener, MapViewConstants { private MapView

open maps/google maps in react native

a 夏天 提交于 2019-12-20 08:36:09
问题 I am trying to open google maps or maps in my react-native application, but when I run the app in my Iphone/simulator I receive the error "Don't know how to open URI:...". What I am doing wrong? My code: openGps() { var url = 'geo:37.484847,-122.148386' this.openExternalApp(url) } openExternalApp(url) { Linking.canOpenURL(url).then(supported => { if (supported) { Linking.openURL(url); } else { console.log('Don\'t know how to open URI: ' + url); } }); } 回答1: To open url with custom label ios

Dynamic Color Fill For Polygon Using Leaflet In Shiny Not Working

自作多情 提交于 2019-12-20 07:21:48
问题 My goal is to create a map that highlights states based on a dropdown menu. I have produced a map that works as intended for one of the metrics in the data set, but when I try and recreate the map in a shiny app the states are all grey rather than varying shades of green. Here is my code: library(shiny) library(tidyverse) library(leaflet) library(dplyr) library(tigris) library(DT) library(rgdal) library(RColorBrewer) #create the UI ui <- fluidPage( #create title titlePanel("Interactions by

Lists.newArrayList和Maps.newHashMap

China☆狼群 提交于 2019-12-20 06:53:53
先看他们创建时的部分源码。 new ArrayList: Lists.newArrayList: Lists和Maps是两个工具类, Lists.newArrayList()其实和new ArrayList()几乎一模一样, 唯一它帮你做的(其实是javac帮你做的), 就是自动推导(不是"倒")尖括号里的数据类型 (泛型)。 new HashMap: Maps.newHashMap: new HashMap 是 java原生API的写法,需要你手动添加泛型,而 Maps.newHashMap 这种是google的guava.jar提供的写法,目的是为了简化代码,不需要你手动写泛型。 当然,他们还有着丰富的重载,这里仅列举部分,感兴趣的朋友可以去打开源码瞅瞅。 来源: CSDN 作者: 想死却又不敢 链接: https://blog.csdn.net/hzw_mvp/article/details/103613617