I was given some encoded polylines to display on a google map. However, I use jQuery for many front-end functions, and now I'm trying to find the correct syntax for displaying encoded polylines using jQuery. The standard syntax for adding an encoded polyline is
var polyline = new GPolyline.fromEncoded({ color: "#0000ff", weight: 4, opacity: 0.8, points: "_gkxEv}|vNM]kB}B}@ q@YKg @ IqCGa@EcA ?c", levels: " P@B @ D??@ @?D?CA?B", zoomFactor: 2, numLevels: 18 }); map.addOverlay(polyline);
Obviously this does not work with jQuery. to add a regular polyline using jQuery which you use
new google.maps.Polyline({ path: stationPathCoordinates1, strokeColor: "#20B5B3", strokeOpacity: 1.0, strokeWeight: 4
Where StationPathCoordinates is an array of longs and lats. Now I have this array in an encoded polyline. I suggested that this might be the new google.maps.Polyline.fromEncoded, but this does not work. Does anyone know the syntax of this in jQuery or if possible?
Thanks in advance
jquery jquery-ui maps
Richw
source share