google-maps-api-3

how to get the newly edited polygon coordinates in google map apiv3

一个人想着一个人 提交于 2020-01-06 12:39:23
问题 i have created and edited polygon successfully and after drawing the polygon i am getting the coordinates of the polygon, what i am looking for is after editing the polygon i am not getting the new coordinates of the polygon(after drag end i am getting the coordinates, immediately the new coordinates should appear as when i draw the polygon happen). my java script: var map; var coords = []; var lats = []; var lngs = []; var myMarkers = []; var myPoly; function initialize() { var latlng = new

Find the total distance of a Polyline segment within a Polygon

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-06 12:27:41
问题 I have a map which will consist of multiple 'zones', each of which are created as polygon overlays. I also allow a user to define a route and using the DirectionsService, I render the route as a polyline on the same map http://i.stack.imgur.com/DDZI1.png. You can see two zones, one in green and another in blue and the route in red. In the final version there will be up to 30 zones defined. What I need to do, is calculate the distance the polyline (route) spends in each zone. The route could

Store locatore, how to use/input my postion?

孤人 提交于 2020-01-06 11:04:08
问题 I am creating a store locator. What is the best way for the user to inputs its location. I need some way to convert the user input into latitude and longitude. How do I go from that the user types something in to converting it into latitude and longitude. Thanks 回答1: First, include the initialization code on page load: var myOptions = { zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); Trigger a function

Google Maps Infobox click through to another marker

守給你的承諾、 提交于 2020-01-06 10:56:45
问题 I am attempting to stop events from firing when an infoBox is opened. The issue is when the Infobox is rendering ontop of other markers, users have the ability to click through the InfoBox and click on the markers behind it. Is there a way to prevent this while still being able to click on a marker not behind the infobox? dropInfoBox = new InfoBox({ content: document.getElementById("pinDrop"), disableAutoPan: false, pixelOffset: new google.maps.Size(-140, 0), zIndex: null, boxStyle: { color:

Google Maps Infobox click through to another marker

為{幸葍}努か 提交于 2020-01-06 10:55:10
问题 I am attempting to stop events from firing when an infoBox is opened. The issue is when the Infobox is rendering ontop of other markers, users have the ability to click through the InfoBox and click on the markers behind it. Is there a way to prevent this while still being able to click on a marker not behind the infobox? dropInfoBox = new InfoBox({ content: document.getElementById("pinDrop"), disableAutoPan: false, pixelOffset: new google.maps.Size(-140, 0), zIndex: null, boxStyle: { color:

Strange Cursor Behavior in Google Maps V3

风流意气都作罢 提交于 2020-01-06 08:56:06
问题 I am trying to change my cursor in google maps to the "wait" cursor while I request information from remote servers. This is weather information from international servers and it can sometimes take a long time to return, so I want the user to know that something is going on. A user clicks on either a marker or a bounding box and then I make the following call to get the data: map.setOptions({draggableCursor: "wait"}); $.ajax({ type:"GET", dateType:"html", url:url, cache:false, success

Google Maps API - Facebook comments

自作多情 提交于 2020-01-06 08:49:09
问题 There has been one other question about this, but he hasn't come up with a solution as of yet. I want to add Facebook comments to each InfoWindow, so that people can comment on particular venues, as a simple review system. At the moment, I've only been able to add a site-wide comments section, that is always present in the sidebar. When someone comments on it, the comments are visible across the whole site, as opposed to being linked to the individual marker/location. Is there a way to have a

Google Map directionsRenderer using polyline miss some routes in waypoints [duplicate]

跟風遠走 提交于 2020-01-06 08:23:47
问题 This question already has an answer here : Google Maps Waypoints not showing whole path (1 answer) Closed 2 years ago . I'm using the Google Map API. I want to show the dotted routes in map. If I add polylineDotted object to google.maps.DirectionsRenderer, it will miss some path on the map. Between point A and point B route is missing(please check my jsfiddle). I had tried not using polylineDotted, it will be OK. var polylineDotted = new google.maps.Polyline({ strokeColor: '#9966ff',

Google Map directionsRenderer using polyline miss some routes in waypoints [duplicate]

戏子无情 提交于 2020-01-06 08:23:07
问题 This question already has an answer here : Google Maps Waypoints not showing whole path (1 answer) Closed 2 years ago . I'm using the Google Map API. I want to show the dotted routes in map. If I add polylineDotted object to google.maps.DirectionsRenderer, it will miss some path on the map. Between point A and point B route is missing(please check my jsfiddle). I had tried not using polylineDotted, it will be OK. var polylineDotted = new google.maps.Polyline({ strokeColor: '#9966ff',

Toggle visibility of polyline using Google API V3

和自甴很熟 提交于 2020-01-06 07:57:07
问题 I know you can toggle visibility of markers using google api, but is it possible to toggle the visibility of a polyline using an html checkbox? Basically, I have a polyline and if the checkbox is checked, I want the polyline visible, and if it is unchecked, I want it hidden. Is this possible? 回答1: You toggle the visibility of a polyline the same way you do a marker. setMap(null) To display it again, call the setMap method with a reference to your google.maps.Map object. documentation setMap