maps

Phonegap - Open Navigation Directions in Apple Maps App

百般思念 提交于 2019-11-29 01:49:33
I have two variables - Destination and Source - and, using Phonegap, I'm trying to use jQuery to open the external iPhone Apple Maps app with directions. The code I'm using looks like this: var url = 'http://maps.apple.com/?q=daddr='+destination+'&saddr='+source; window.location = url; Whenever I click the relevant button however, it opens a new view in-app with Google directions as a webview, and I cannot return to the original app. How can link be opened instead with the iOS default map application? Changing http://maps.apple.com/?q= to just maps: did the trick. NB: make sure you write maps:

How to get current location or move to current location in Xamarin.Forms.Map

筅森魡賤 提交于 2019-11-28 23:28:27
Since the Map already shows the user location (with IsShowingUser) I just want to zoom to this location. Is this easily possible or do I need to get the location on every platform, since I don't find any GeoLocation object. Only the GeoCoder... Is this not a common usecase to zoom to users position? Giorgi You will need to call MoveToRegion method with the position you are interested in. You can use Geolocator Plugin for Xamarin to get the location in PCL project: var locator = CrossGeolocator.Current; var position = await locator.GetPositionAsync(10000); map.MoveToRegion(MapSpan

Can I prevent panning Leaflet map out of the world's edge?

陌路散爱 提交于 2019-11-28 23:10:13
Is there a way to limit panning out of the world's edge? On this picture, brown is the world, grey is emptiness. I want to make it impossible to pan like this. Leaflet allows you to control how much the map resists being dragged out of bounds with the maxBoundsViscosity option (value: 0 to 1). Setting it to maximum disables dragging out of bounds entirely. var map = new L.Map('map', { center: bounds.getCenter(), zoom: 5, layers: [osm], maxBounds: bounds, maxBoundsViscosity: 1.0 }); This feature is available in 1.0.0. The relevant pull request includes a working example : var osmUrl = 'http://

Google map API v2 is not working

安稳与你 提交于 2019-11-28 22:00:15
I am trying to run sample code mention here : Google Maps Android API V2 Sample code but i am getting error NoClassDefFound. Below is my logcat. Can any one help me to solve it. Any help is highly appricated Thanks 12-04 18:04:18.854: E/AndroidRuntime(1801): java.lang.ExceptionInInitializerError 12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.Class.newInstanceImpl(Native Method) 12-04 18:04:18.854: E/AndroidRuntime(1801): at java.lang.Class.newInstance(Class.java:1319) 12-04 18:04:18.854: E/AndroidRuntime(1801): at android.app.Instrumentation.newActivity(Instrumentation.java:1053) 12

Voronoi diagram polygons enclosed in geographic borders

人走茶凉 提交于 2019-11-28 20:46:38
I am trying to create Voronoi polygons (aka Dirichlet tessellations or Thiessen polygons) within a fixed geographic region for a set of points. However, I am having trouble finding a method in R that will bound the polygons within the map borders. My main goal is to get accurate area calculations (not simply to produce a visual plot). For example, the following visually communicates what I'm trying to achieve: library(maps) library(deldir) data(countyMapEnv) counties <- map('county', c('maryland,carroll','maryland,frederick', 'maryland,montgomery', 'maryland,howard'), interior=FALSE) x <- c(

Suppressing Google Maps Intent Selection Dialog

强颜欢笑 提交于 2019-11-28 19:55:34
When I use this code string url = "somegooglemapsurl.com"; Intent mapLauncherIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(url)); startActivity(mapLauncherIntent); A selection dialog pops up asking if I want to open this map in the maps application or the browser. I'd like the transition from my application activity to Google Maps to be seamless. How can I suppress this dialog and tell android to open the map in the maps activity? EDIT: When I get into Google Maps I want to open a directions prompt using public transpiration in a certain location. I can do this through a

leaflet.js - Set marker on click, update position on drag

房东的猫 提交于 2019-11-28 19:38:43
for a small project I am working on, I need to be able to place a marker on a leaflet.js powered image-map and update the position of this marker, if it gets dragged. I use the following code to try this, but it fails. I get the error 'marker not defined'. I don't know why it's not working - maybe you guys could help me out? ;) function onMapClick(e) { gib_uni(); marker = new L.marker(e.latlng, {id:uni, icon:redIcon, draggable:'true'}; map.addLayer(marker); }; marker.on('dragend', function(event){ var marker = event.target; var position = marker.getLatLng(); alert(position); marker.setLatLng(

Determine if point is within bounding box

ぐ巨炮叔叔 提交于 2019-11-28 18:54:33
How would you determine if a given point is within the bounding box? My point is 48.847172 , 2.386597. Boundingbox: "48.7998602295", "48.8198640442", "2.46138595581", "2.48138619423" Do just as usual: if( bb.ix <= p.x && p.x <= bb.ax && bb.iy <= p.y && p.y <= bb.ay ) { // Point is in bounding box } bb is the bounding box, (ix,iy) are its top-left coordinates, and (ax,ay) its bottom-right coordinates. p is the point and (x,y) its coordinates. This solution also takes in consideration a case in which the UI sends a box which crosses longitude 180/-180 (maps views on low zoom level where you can

Android Maps V2 MapView inside custom fragment (NPE)

你离开我真会死。 提交于 2019-11-28 18:45:49
I do not want to use or extend SupportMapFragment or MapFragment . I have my own base class with a bunch of code in it. The documentation clearly states that when someone uses MapView by itself, all corresponding lifecycle methods ( onCreate() onResume() etc.) should be called. Most of the lifecycle methods in a Fragment are similar to an Activity but when I switch back and forth between my Fragment I eventually get an obfuscated NPE in onDestroy() or in onResume() methods. All the samples provided use an Activity with a MapView but not a custom Fragment . Has someone done that already? Can

How to efficiently compare two maps of strings in C++ only for a subset of the keys

雨燕双飞 提交于 2019-11-28 18:45:02
问题 I'm wondering if only by applying some standard algorithms is possible to write a short function which compare two std::map<string, string> and returns true if all the key-value (but some) pairs are true. For example, these two maps should be evaluated as equal map<string,string> m1, m2; m1["A"]="1"; m2["A"]="1"; m1["B"]="2"; m2["B"]="2"; m1["X"]="30"; m2["X"]="340"; m1["Y"]="53"; m2["Y"]="0"; Suppose that the two maps have same size and all their elements must be pairwise compared except the