OK, those last two replies turned some lightbulbs on, thanks.
Following is the code I now have with escaped quotes and double-
escaped backslashes in the encoded polylines. Unfortunately, I see
only the markers, but none of the polylines displayed by the browser
(Firefox).

Also a couple of new issues were brought up by the responses:
1. Andrew: the polylevel array entries (all the B's) were just the
exact values returned by the google encode utility; I copied them as-
is into the corresponding array entry. I'll read further to see if
there is a way to reduce them.
2. Larry: am not sure why the blue markers are squished. This is
lifted from the google maps example code and I can't see any css or
other section in the code that sets the dimension for the markers -
only for the area of the displayed map. Again, I'll need to look
further.

Any further inputs on why the multiple polyline overlays are not
displaying on the map?

Jeff



        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...@bz@dbp...@`|@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 = pointZ[ i ];
                                                map.addOverlay(new 
GMarker(point, markerOptions));
                                        }
//                                      GEvent.addDomListener( window, 'load', 
map2_initialize );

On Nov 2, 10:48 am, Andrew Leach <[email protected]>
wrote:
> Someone else chipping in...
>
> On Nov 2, 4:31 pm, Jeff <[email protected]> wrote:
>
> > But I'm missing something in how I'm trying to reference the array
> > entry in a line like:
>
> >     points: polylineZ[ i ],
> >     levels:  polylevelZ[ i ],
>
> That should work, provided that polylineZ[i] contains a valid string
> of points. This:
> var polylevelZ = new Array(
>   '"BBBBBB"',
>   '"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"',
>   '"BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB"'
>   );
> doesn't. You delimit your strings with the single quotes, and they
> contain the double-quotes. So those strings contain invalid characters
> at the beginning and end.
>
> The points strings contain backslashes. That means that the two
> characters (say) \M don't actually mean two separate characters. \M
> means character 13 (Carriage-return). To make the backslash mean a
> backslash, you need to escape it, so \\M would mean a literal
> backslash followed by M.
>
> You need to look up Mark McClure's documentation for encoding. A
> levels string of all Bs isn't very 
> useful.http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/
>
> Andrew
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to