maps

How to find closest marker leaflet.js

久未见 提交于 2019-12-05 03:44:48
I was wondering if there is actually some way to find markers near my position using leaflet.js. The first think to come to my head is to store lat and lng of my position and then iterate over an array of lat and lng markers placing them in an array an then sort that array. I am not sure if this is a good option because if you have a million markers in the map is going to take a while. Pseudo code var myLatLng = [34,56]; var markers = [[20,30],[10,20],[12,-100],[54,90],[-10, -20],[20,20]]; var closests = []; function findNearestMarker (myPosition, nearestMarkers){ for(var i = 0; i <

Using the Google Maps JavaScript API to add a 'place-card' to an embedded map?

北慕城南 提交于 2019-12-05 02:56:08
问题 Does anyone know how to enable the 'place-card' on an embedded Google Map using the Google Maps JavaScript API? When I use the Google Maps Embed API a 'place-card' will be present in the top left corner of the map. This 'place-card' includes the address, a 'Directions' link, and a 'View larger map' link. I would prefer to use the Google Maps JavaScript API to embed my map but when I create a map using this API the place-card is missing and the 'view larger map' link is replaced with a subtle

Google Maps API function map.getCenter()

那年仲夏 提交于 2019-12-05 01:40:31
I'm saving the Zoom and Location of the Google Map API setting in cookies as the user adjusts his map. When they come back the map is at the same place. The function works most of the time: var h = JSON.stringify(map.getCenter(), null, 2); jQuery.cookies.set("YD44635center",h,cookieOptions); On the decode side using: locationVar = jQuery.cookies.get("YD44635center"); var temp = ""; // for testing: for(var x in locationVar){ temp += x + "\n"; } alert(temp); To see what I'm getting, most of the time, is: Qa; Pa; So I set my code to load the map with those variables and everything is fine. Then

Google Maps API vs Google Maps Engine?

删除回忆录丶 提交于 2019-12-05 01:01:44
I'm brand new to web technologies, and in researching a web app that I want to create I got a little bogged down. I want to be able to use a Google Map on my site, including the functionality that allows you to use layers and draw shapes and lines on top of it, but I'm confused at the difference between the Google Maps API and Google Maps Engine and which one would best suit me. Is one of those a better option for me? There seems to be a lot of red tape on getting Maps Engine for a site, but I'm unclear on if Maps API has all the functionality I'd want. Sorry for the beginner question, but I

Navigate through a pre-known map offline using Phonegap

房东的猫 提交于 2019-12-05 00:51:54
问题 Hello and thank you in advance, I would like to ask if there is a way to compile pre-known google map tiles and load them up in a Phonegap application. To be more specific, I am developing an application that will concern geolocation, path navigation etc, within a specific region. Due to the nature of use of the application (it might be used in the wildlife for example) the phone of the user may not get signal in order to have an internet connection, hence I want the interactive map facility

swift get directions in maps app

筅森魡賤 提交于 2019-12-05 00:48:07
问题 I have an app that displays multiple locations in multiple mapviews. How can I add a button that allows the user to open one of these locations in their maps app and to get directions to it? 回答1: If you got an MKPlaceMark you can use an MKMapItem and open the Map-app with the location as launchOption : var mapItem = MKMapItem(placemark: yourPlaceMark) mapItem.name = "The way I want to go" //You could also choose: MKLaunchOptionsDirectionsModeWalking var launchOptions =

MKLocalSearch doesn't provide the same results as search in native Apple Maps app

倾然丶 夕夏残阳落幕 提交于 2019-12-05 00:38:19
问题 When I search in MKLocalSearch and Apple Maps using the same string I get different results, usually in Apple Maps I get a lot of different locations but in MKLocalSearch I get only one. Apple Maps: My app using MKLocalSearch: In both cases I was searching being in Berlin and in MKLocalSearchRequest I set .region property of Berlin region Which services does Apple use for their location search? 回答1: After doing some searching I've investigated that MKLocalSearchCompleter is the class that

How to compare two routes using google direction apis or some other apis for iPhone app

馋奶兔 提交于 2019-12-04 22:33:49
问题 I want to compare two routes to check if they are same or not in my iPhone app. There is a person X who wants to go to point A to point B and another person wants to go to point A1 to point B1. I can get a route between A to B using this direction APIs of google. http://maps.googleapis.com/maps/api/directions/xml?origin=Point a A address&destination=Point B address&sensor=false same way I can get route of A1 to B1. but the latitude and longitude I am getting in xmls are not matching (even a

How to work with Maps in Kotlin

不问归期 提交于 2019-12-04 22:12:37
The code below is creating a new map called nameTable , then adding an entry named example to it, then trying to print the name property of the Value. When I run it, it seems that the plus operation didn't add a new entry to the map like I thought it would. So what am I doing wrong? class Person(name1: String, lastName1: String, age1: Int){ var name: String = name1 var lastName: String = lastName1 var age: Int = age1 } var nameTable: MutableMap<String, Person> = mutableMapOf() var example = Person("Josh", "Cohen", 24) fun main (args: Array<String>){ nameTable.plus(Pair("person1", example)) for

How to display markers (huge numbers) on a map which has been logically divided into segments?

社会主义新天地 提交于 2019-12-04 21:54:40
What i have done so far: i'm developing an application where i have to display more than(50K) points/Markers on the Navteq map divided into different segments. for example: if i have 50K points i will divide all points into different segments. if i divide 50K points into 50 segments each segment would have 1000 points (may not be 50 segments , it may depend). right now it is working but it takes long time and hangs to render all the points on the MAP.so that i would like to perform segmentation displaying to display only few points with clustering. so that i can get an idea of how the segment