google-maps-api-3

Move a LatLng 5 meters towards another LatLng

我与影子孤独终老i 提交于 2019-12-21 04:42:31
问题 What algorithm/formula can I use to calculate a LatLng point 5 meters closer to another LatLng point? I'm trying to write a function with 2 LatLng parameters and have it return a LatLng that is 5 meters from the first LatLng and in the direction of the second LatLng. 回答1: Have a look at Android Map Utils library, specifically the SphericalUtil class. 1.) Call the method computeHeading to obtain your heading from first to second 2.) Call the method computeOffset to solve for the location 5

Android (MapView): How to set Zoom level of 4 miles in the mapview?

ぐ巨炮叔叔 提交于 2019-12-21 04:33:10
问题 I have a latitude and longitude(GeoPoint) which is the center of map. I want to set zoom level of 4miles distance from latitude and longitude that I have. Thanks in Advance, 回答1: You can use the setzoom()-function to do so. The code below can be found in this example. mc = mapView.getController(); String coordinates[] = {"1.352566007", "103.78921587"}; double lat = Double.parseDouble(coordinates[0]); double lng = Double.parseDouble(coordinates[1]); p = new GeoPoint( (int) (lat * 1E6), (int)

How to override KML colors in Google Map?

早过忘川 提交于 2019-12-21 04:26:14
问题 I am loading a KML file via Google Map's V3 API. The colors in the KML file are being used but I would like to override it with my own color. I actually want to use a solid color for the whole trace. Is there a way to do this? 回答1: KML colors are based on Style api-doc tags that are defined either directly in the KML or using a reference to an external KML style file (similar to CSS). We use an external style file, so that the styles may be applied to multiple KML files. This means that

Find route with Androids Google Maps API

寵の児 提交于 2019-12-21 04:26:09
问题 I want to be able to display the route between two user-defined geographical points using the Google Maps API for Android. I also want to be able to let the user choose what type of route to display, whether it be walking, cycling, car etc. Additionally, I want to be able to calculate the time and distance it would take to use this route. I've tried searching the web and looking at other stackoverflow questions, but to no avail. How would I go about this? How would I be able to code this. //-

Google Maps API v3 - Different markers/labels on different zoom levels

浪子不回头ぞ 提交于 2019-12-21 04:11:31
问题 I was wondering if it is possible that Google has a feature to view different markers on different zoom levels. For example, on zoom level 1, I want one marker over China with the label saying "5". And as the user zooms in, lets say on zoom level 4, I want the previous marker and label to disappear. And I want to have 5 new markers/labels, each on a different city in China all saying "1". Thus China will say a number and all the cities in China will say numbers adding up to China's number.

Using Google Places Search Box. How to initiate a search by clicking a button?

浪子不回头ぞ 提交于 2019-12-21 04:03:10
问题 Either I am an idiot or this was an egregious oversight on the part of the Google Maps team. I am attempting to trigger a places search request on a button click event in conjunction with the standard enter keypress event (which is currently working fine). I have combed through the documentation related to the Google Places search box and have found no sutiable solution. Because of confidentiality reasons I am using the example from the demo. function initialize() { var map = new google.maps

“My Location” in Google Maps javascript API

…衆ロ難τιáo~ 提交于 2019-12-21 03:50:46
问题 Is there a way to use the "My location" button that exist on Google Maps in your own webbapplication using the javascript api? I have read about adding controls here Google Maps Javascript API V3 Controls but I haven't found anything about the "My locaton" control. 回答1: There's currently no geolocation button in Google Maps API v3. But it's not difficult to implement one yourself. Information about implementing geolocation can be found in the Google Maps Javascript API documentation. If you

How to know radius while drawing a circle on Google Maps

主宰稳场 提交于 2019-12-21 03:37:21
问题 What I have : As per Google suggestion we have used MVC object and the events DistanceWidget & RadiusWidget to display the radius while re-sizing the circle which is working fine for existing circle (circle drawn by DistanceWidget). Fiddle Demo What I need : I need to show the radius of the circle while drawing a new circle. The event DistanceWidget & RadiusWidget are used only for existing circle (circle drawn by DistanceWidget ) not for new circle (user drawn circle by using DrawingManager

Map Routing, a la Google Maps?

不问归期 提交于 2019-12-21 03:18:52
问题 I've always been intrigued by Map Routing, but I've never found any good introductory (or even advanced!) level tutorials on it. Does anybody have any pointers, hints, etc? Update: I'm primarily looking for pointers as to how a map system is implemented (data structures, algorithms, etc). 回答1: Take a look at the open street map project to see how this sort of thing is being tackled in a truely free software project using only user supplied and licensed data and have a wiki containing stuff

How to clear the input bound to the Google Places Autocomplete?

一世执手 提交于 2019-12-21 03:17:13
问题 Here is my issue: I am using Google Places Autocomplete to gather information about places from the user. On the event "place_changed", I save this information. However I want to give the user the possibility to add multiple places. So after this place has been save I want to clear the input. However Google Autocomplete automatically replace the last entry in the input field. Anyway to get rid of that? The details : var inputDiv = $('#myinput'); var options = { types: ['(cities)'] }; var