google-maps-api-3

How to find the nearest cities in Google map API

青春壹個敷衍的年華 提交于 2020-01-11 07:37:09
问题 I want to find the nearest cities in the Australia which city i gave for example In this look out the examples. I tried wit h Google API but no use .How can i achieve like this. Could you help me? code is var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); var request = { location: fenway, radius: 500, types: ['store'] }; var service = new google.maps.places.PlacesService(map); service.search(request, callback); function callback(results, status) { if (status ==

Google Maps transparent image overlay

可紊 提交于 2020-01-11 07:12:13
问题 Im looking for some examples of a transparent fixed postion image that overlays a map. When moving the map, the transparent image should not move and the markers should appear on top of the image. Does anyone know of any examples? 回答1: There's a way with a div on top of another one. It positions a + marker over the center of the map. http://code.google.com/p/gmaps-samples-v3/source/browse/trunk/geocoder/getlatlng.html the crosshair image is http://code.google.com/p/gmaps-samples-v3/source

Google Maps API v3: custom markers not clickable on mobile devices

会有一股神秘感。 提交于 2020-01-11 06:36:11
问题 We have a site that uses Google Maps API v3 to display a bunch of markers on the map. The markers are clickable, and open a standard Google Maps info popup. This works great on all desktop browsers. But for some reason, I can't make it work on any mobile device that I've tested (a variety of Android and iOS devices). The markers simply don't respond to clicks. I've narrowed it down to our custom markers. If I remove the code that loads our custom marker images using new google.maps

SVG marker on Google Maps V3

北慕城南 提交于 2020-01-11 03:58:06
问题 Using Google Maps API v3, my ultimate intent is to create an arrow of a given length and angle, but for now, I am trying to create an SVG marker. I am using the Rich Market utility and the jquery.svg plugin. The following code creates the div , but doesn't create the SVG. Suggestions? (I am not wedded to these libraries, but these are what I found so far). <head> <script type="text/javascript"> var map, marker; function drawCircle(svg) { svg.circle(15, 15, 10, {fill: 'none', stroke: 'red',

How to enable and disable the drawingControlOptions in Google Maps?

浪子不回头ぞ 提交于 2020-01-11 03:15:08
问题 I am having three different buttons for drawing shapes. Clicking each button the exclusive drawing option should be enabled and also the other options should become disabled. My code is following. drawShape.js File The following is my Javascript code. I am having three separate methods to draw shapes(circle, rectangle, polygon). By the below code, by each click I am getting new drawing controller. Please me to correct it. google.maps.visualRefresh = true; var rectangles = []; var coordinates

How to secure my Google Maps Javascript V3 API Key within an Ionic/Cordova App?

落爺英雄遲暮 提交于 2020-01-10 19:57:10
问题 I am currently developing an Ionic app where I have an embedded Google Map. The Google Maps V3 API recommends using an API key for tracking usage. The thing is when I create an API Key for browser usage I can only secure my API key by specifying referrers. Now I don't have a referrer on mobile devices so what can I do to avoid that other people can also use my API key? 回答1: The way I see it you have two options: You can not secure it at all, since in order for someone to get the key they will

Google Maps : open InfoWindow on mouseover, close & reopen on click

蓝咒 提交于 2020-01-10 14:45:48
问题 I've a page with markers with InfoWindows that I opened on Click. I decided to rather open the InfoWindows on MouseOver which is working. But I find that having to move the mouse to the cross of the InfoWindow to close it is a bit demanding for these lazy visitors of the internet. So I added a Close event on Click of the Marker which is also working. What I can't figure out to work is to be able to re-open the InfoWindow on Marker Click instead of having to mouseout in order to be able to re

Google Maps : open InfoWindow on mouseover, close & reopen on click

帅比萌擦擦* 提交于 2020-01-10 14:45:17
问题 I've a page with markers with InfoWindows that I opened on Click. I decided to rather open the InfoWindows on MouseOver which is working. But I find that having to move the mouse to the cross of the InfoWindow to close it is a bit demanding for these lazy visitors of the internet. So I added a Close event on Click of the Marker which is also working. What I can't figure out to work is to be able to re-open the InfoWindow on Marker Click instead of having to mouseout in order to be able to re

Google Maps : open InfoWindow on mouseover, close & reopen on click

浪尽此生 提交于 2020-01-10 14:45:12
问题 I've a page with markers with InfoWindows that I opened on Click. I decided to rather open the InfoWindows on MouseOver which is working. But I find that having to move the mouse to the cross of the InfoWindow to close it is a bit demanding for these lazy visitors of the internet. So I added a Close event on Click of the Marker which is also working. What I can't figure out to work is to be able to re-open the InfoWindow on Marker Click instead of having to mouseout in order to be able to re

Google Direction API and Google Maps App showing different routes for same destination

浪尽此生 提交于 2020-01-10 06:07:09
问题 I am working on an app in which I have to show shortest route. I am using Google Direction API but the result is different from Google Maps app for same destination and travel mode. https://maps.googleapis.com/maps/api/directions/json?origin=19.107163,72.862375&destination=19.106995400000002,72.8643029&sensor=false&mode=driving&alternatives=true&key=XXXXXXXXXXXXXXXXXX Since alternative is true I am already using shortest route from available routes (response). Note : - When I enter lat lng of