google-maps-api-3

how to parse a Google Maps geocoding result

冷暖自知 提交于 2020-01-21 08:21:08
问题 I want to retrieve Geo address from given latitude and longitude using geocoding, using the given example on the site http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true I just need city name New York in this example and country name i.e United States. But the problem is there are more than one appearances of these words as long_name. My question how can I parse this json/xml in php to get just city name and country. $url= file_get_contents('http://maps

Change GMSMapView default map background color in iOS

你。 提交于 2020-01-20 08:46:08
问题 The GMSMapView in iOS has a default background color of tan, or something like it. I have a requirement to change that color to white. I've tried using a subclass of GMSTileLayer without success (or errors). I need to place custom map overlays with white backgrounds onto the map view. In areas without the overlays, the base map color needs to match (white). Tried the following without any luck: [mapView setBackgroundColor:[UIColor whiteColor]]; Can anyone offer suggestions, or point me to a

How to hide or display a Google Maps Layer?

倖福魔咒の 提交于 2020-01-20 05:10:06
问题 I have prepared a simplified test case and a screenshot. I think I'm missing a tiny bit, just few lines of code. I have 2 overlays (the weather and clouds) in my JavaScript Google Map and would like to hide or show them when a corresponding check box is clicked: Here is the test case, just paste it into an .html file and it will run: <!DOCTYPE HTML> <html> <head> <style type="text/css"> h1,p { text-align: center; } #map { width: 700px; height: 400px; margin-left: auto; margin-right: auto;

Adding simple marker clusterer to google map

三世轮回 提交于 2020-01-19 03:28:07
问题 I'm having problems with adding marker clusterer functionality to my map. What I want is to use custom icon for my markers and every marker has its own info window which I want to be able to edit. I did accomplish that, but now I have problems adding marker clusterer library functionality. I read something about adding markers to array, but I'm not sure what would it exactly mean. Besides, all of the examples with array I have found, don't have info windows and searching through the code I

Adding simple marker clusterer to google map

六月ゝ 毕业季﹏ 提交于 2020-01-19 03:28:05
问题 I'm having problems with adding marker clusterer functionality to my map. What I want is to use custom icon for my markers and every marker has its own info window which I want to be able to edit. I did accomplish that, but now I have problems adding marker clusterer library functionality. I read something about adding markers to array, but I'm not sure what would it exactly mean. Besides, all of the examples with array I have found, don't have info windows and searching through the code I

Transfer google map coordinates to mysql database

非 Y 不嫁゛ 提交于 2020-01-17 17:02:11
问题 I have a google map where the user can create a polyline. I have stored the polyline (lat,lng)coordinates into an array. Now i want to use php or javascript to transfer these coordinates to a mysql database or is there other better options? How should i proceed? Here is my code: (function() { window.onload = function() { var path; var marker; var infowindow; var places = []; //create reference to div tag in HTML file var mapDiv = document.getElementById('map'); // option properties of map var

Display multiple points on google map by fetching the names from database

旧街凉风 提交于 2020-01-17 15:09:32
问题 I am new in JSP. I have a requirement where i have to build a webpage which will fetch records of address fields(consist of Street,region,city,exchange,country name) from Database and will display the same on google map with markers. For this i am not having the latitude/longitude of the address but have the physical address details in the database. Can someone please suggest me on this. The current code i am having is like as below, bit it need latitude/langitue and also it for a single

Is it possible to put a marker after some “km” from the start point in a DirectionsService's route?

对着背影说爱祢 提交于 2020-01-17 14:47:49
问题 This is my code : var request = { origin: start, destination: end, travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function (response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); now, I'd like to put a marker after 200km from the point origin: start : is it possible? 回答1: Here is an example that puts two markers on a route (one at 9.5km and one at 64.8km): http://www.geocodezip.com/v3

Google Maps JavaScript API: How to remove individual marker?

余生长醉 提交于 2020-01-17 12:24:39
问题 I'm using the Google Maps v3 library, with the Multi-Marker library which extends the functionality of Google Maps for super fast adding of map marker icons to a map. I can't figure out how to remove a single , individual map marker using the multi-marker library linked above. Does anyone have any ideas how I'd do this using the multi-marker library (and/or Google Maps)? I've tried contacting the lead developer of the project but am not getting a response. Thanks for any help. Also, linked is

Call function initmap with parameters in gmaps api

荒凉一梦 提交于 2020-01-17 08:35:33
问题 I have this function, the default function from google maps api tutorial, I have just added 2 parameters latt and lngg. function initMap(latt,lngg) { var uluru = {lat: latt , lng: lngg}; var map = new google.maps.Map(document.getElementById('map'), { zoom: 15, center: uluru }); var marker = new google.maps.Marker({ position: uluru, map: map }); } And I want to call it like they call it : <script async defer src="https://maps.googleapis.com/maps/api/js?key