Problem using array of strings for display of multiple encoded polylines
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|xDzmdtQrPf`@n]fQdfAjzBtO|i@zX`OmE~Ls\?zLpV~c@nF_KbyA]|Zq]kD
[hRwNlc@i`@mTwAgQwNqGqPjp@qPvJeUhRoEkSyM}L[g`@|KcAqDcOnEaO}d@|
[cVsHvAqUzLgQ}c@dA]vXoj@iRoD_\}d@mT??vZ{fAkFi~@}d@qs@pi@}x@bz@dBpPqd@`|
@sW\"",
"\"qofyDfzgtQeUp_Bn]l`Aus@~vAbVxeAxjAtf@tB|[vr@|
ZzXmElRf`@f`@jSze@lxC`c@jnAsmAps@{XgQq
\d_@wf@tHrClTco@zh@uNtf@`WbPcJtf@|Wvf@wArWyMlb@}
c@`xAidAnaAoEzh@xMdn@nDxeA{p@lxCo]nd@qDvX{p@vXwf@eQcsDfjB}
Kf`@zhAd_@nu@ztAiGtf@fHlc@wM~j@cz@bOoi@oTmnA`]eIb^dUzZkFl
{B~VpkCdqAzfAi_@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 google-maps-api@googlegroups.com
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home