I am trying to display multiple polylines using arrays. I use a LatLng array, an array of the encoded polylines, and an array of polylevels. Then I have two loops to provide the API calls to overlay the encoded polylines and markers.
My question concerns the polyline/polylevel array entries and the variable format in the API calls - I can't figure out how to get quotes around the calls that are required by the API for points and levels. The quoted entries in the array are not doing the job. How can I format the correct API calls using these arrays of strings? Thanks for any assistance! Jeff A link to the test: http://www.azimotion.com/mapsmash.html The snippet of code: var pointZ = [ new GLatLng( 30.187712, -98.216400 ), new GLatLng( 30.306760, -97.977276 ), new GLatLng( 30.449818, -97.905178 ), new GLatLng( 30.511212, -98.039589 ), new GLatLng( 30.220944, -97.101288 ), new GLatLng( 30.257046, -97.746906) ]; var polylineZ = new Array( "\"iygwDrnmvQxzCldE|r...@fcrqc~le`_cnycxmvff\"", "\"kg|xdzmdtqr...@n]fqdfajzbto|i...@zx`ome~ls\?zlpv~c@nF_KbyA]|Zq]kD [hrw...@i`@mtwagqwnqgq...@qpvjeuhroeksym}l[g`@|KcAqDcOnEaO}d@| [cvshvaquzlg...@da]vxoj@irod_...@mt??vz{fakfi~@}...@qs@p...@}x@b...@dbppqd@`| @sW\"", "\"qofydfzgtqeup_bn]l`...@~vabvxeaxjatf@tB|[vr@| zzxmel...@f`@j...@lxc`c@jnasm...@{xgqq \...@wf@thrcl...@zh@u...@`wbpcjtf@|w...@warwymlb@} c...@`xaidanaaoezh@x...@ndxea{p@lxco...@qdvx{p@v...@eqcsdfjb} k...@zhad_@n...@ztaigtf@f...@wm~j@c...@booi@oTmnA`]eIb^dUzZkFl {b~vpkcdqazf...@t~b\"" ); var polylevelZ = new Array( "\"BBBBBB\"", "\"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\"", "\"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\"" ); for (var i = 0; i < polylineZ.length; i++ ) { // document.write( polylineZ [ i ] ); var encodedPolyline = new GPolyline.fromEncoded ({ color: "#3333cc", weight: 10, points: polylineZ[ i ], levels: polylevelZ[ i ], zoomFactor: 32, numLevels: 4 }); map.addOverlay(encodedPolyline); } for (var i = 0; i < pointZ.length; i++ ) { var point = new pointZ[ i ]; // map.addOverlay(new GMarker(pointZ[ i ], markerOptions)); map.addOverlay(new GMarker(point, markerOptions)); } // GEvent.addDomListener( window, 'load', map2_initialize ); --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en -~----------~----~----~----~------~----~------~--~---
