google-polyline

google map multiple polyline

牧云@^-^@ 提交于 2019-12-01 10:29:26
I have a google map sample with multiple polygons. I changed the new google.maps.Polygon function to polyline as new google.maps.Polyline({ paths: arr, strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 2, fillColor: '#FF0000', fillOpacity: 0.35 }) But it does not drawing the lines. Fiddle here . Also how to set object name to infowindow content. I tried with var infowindow = new google.maps.InfoWindow({ content: i }); Edited fiddle . A google.maps.Polyline doesn't have a paths property. Change: new google.maps.Polyline({ paths: arr, strokeColor: '#FF0000', strokeOpacity: 0.8,

google maps middle of a polyline (centroid?)

拜拜、爱过 提交于 2019-12-01 09:24:52
I have a list of polylines, just like google maps does when I click on the polyline I want an infowindow to show up just where I clicked, and it works just fine with this function function mapsInfoWindow(polyline, content) { google.maps.event.addListener(polyline, 'click', function(event) { infowindow.content = content; infowindow.position = event.latLng; infowindow.open(map); }); } the problem comes when I click on the list(using the same function for that), event obviously doesn't have the latLng , but I'd like infowindow to show up in the middle of the polyline anyway, just like it does

google map multiple polyline

社会主义新天地 提交于 2019-12-01 08:50:23
问题 I have a google map sample with multiple polygons. I changed the new google.maps.Polygon function to polyline as new google.maps.Polyline({ paths: arr, strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 2, fillColor: '#FF0000', fillOpacity: 0.35 }) But it does not drawing the lines. Fiddle here. Also how to set object name to infowindow content. I tried with var infowindow = new google.maps.InfoWindow({ content: i }); Edited fiddle. 回答1: A google.maps.Polyline doesn't have a paths

google maps middle of a polyline (centroid?)

有些话、适合烂在心里 提交于 2019-12-01 06:56:14
问题 I have a list of polylines, just like google maps does when I click on the polyline I want an infowindow to show up just where I clicked, and it works just fine with this function function mapsInfoWindow(polyline, content) { google.maps.event.addListener(polyline, 'click', function(event) { infowindow.content = content; infowindow.position = event.latLng; infowindow.open(map); }); } the problem comes when I click on the list(using the same function for that), event obviously doesn't have the

Google Maps for iOS, swift - How to show entire polyline between markers?

空扰寡人 提交于 2019-12-01 05:52:30
I am trying to fit a polyline in the google map view. The polyline was acquired through overview_polyline in the google maps directions api. Wondering how I would be able to convert an encoded polyline into something that can be worked with. I need to fit the polyline in the map view. All i have found out to do is fit the bounds to show all markers but not showcase the entire polyline. func fitAllMarkers() { var bounds = GMSCoordinateBounds() for marker in markers { bounds = bounds.includingCoordinate(marker.position) } googleMapView.animateWithCameraUpdate(GMSCameraUpdate.fitBounds(bounds)) }

distance of a polyline

倾然丶 夕夏残阳落幕 提交于 2019-12-01 01:43:19
I am working in a polyline and I need to obtain the distance of this. So if anyone can help I would be very gratefully. Best regards. This is my code: function polyline() { downloadUrl("xmlPolyline.asp", function(data) { var xml = xmlParse(data); var markersPath = xml.documentElement.getElementsByTagName("marker"); var path = []; for (var i = 0; i < markersPath.length; i++) { var lat = parseFloat(markersPath[i].getAttribute("lat")); var lng = parseFloat(markersPath[i].getAttribute("lng")); pointPath = new google.maps.LatLng(lat,lng); path.push(pointPath); }//finish loop polyline = new google

distance of a polyline

谁说胖子不能爱 提交于 2019-11-30 20:12:55
问题 I am working in a polyline and I need to obtain the distance of this. So if anyone can help I would be very gratefully. Best regards. This is my code: function polyline() { downloadUrl("xmlPolyline.asp", function(data) { var xml = xmlParse(data); var markersPath = xml.documentElement.getElementsByTagName("marker"); var path = []; for (var i = 0; i < markersPath.length; i++) { var lat = parseFloat(markersPath[i].getAttribute("lat")); var lng = parseFloat(markersPath[i].getAttribute("lng"));

Merging multiple encoded polylines into one encoded polyline

让人想犯罪 __ 提交于 2019-11-30 13:41:57
I'm trying to merge a new encoded polyline with an existing polyline without decoding and reencoding the whole polyline. The new encoded polyline will be uploaded to a (linux) server where I would like to append it to the existing polyline. The problem is, you can't just mash them together. Below is some sample data to play with. My hope is to find/create a solution in either PHP or a shell script but the problem is, I have no where near enough technical understanding to interpret the encoded polyline algorithm. 41.386692,-73.475912 41.424822,-73.375027 41.428292,-73.311173 41.426183,-73

Google Map SDK: Draw correct polyline in google map as Device Moves in Background

喜你入骨 提交于 2019-11-30 08:37:18
问题 I am using Google Map SDK for iOS. I am drawing polylines in Driving mode. But when i stop,and Zoom google map then, my Current position cursor automatically moves and redraw zigzag polylines, due to that all previous polylines drawn get overlapped and polylines get completely changed.Same things happens when i go in background and drive. Could i know why is it happening? And How can I draw smooth polylines in driving and walking mode same time in same path. My Code- - (void)locationManager:

Get Array of all points of Polygon - Google Maps Drawing Tool API-3

寵の児 提交于 2019-11-30 07:52:46
i am using Google Drawing tools for drawing polygon/rectangle on google maps, now i need to show markers that falls inside the drawn polygon and for that i am using geometry.poly.containsLocation method which takes a point(latLng) and an array of polygon points. if i use maps.polygon I can get polygon points via poly.getPath() but because i am using Google Drawing tools which uses maps.drawing.DrawingManager/google.maps.drawing.OverlayType.POLYGON so not sure how to find points here. Thanks var drawingManager = new google.maps.drawing.DrawingManager({ drawingMode: google.maps.drawing