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?
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 );
If this is what you mean, I tried substituting ' " ... " ' for
"\" ... \""; in the array entries but that didn't work; no spaces
between single and double quote - I just typed in this response for
clarity.
I'm googling for explanations on why double escaping would work. The
original quote did correctly show the "..." in the encoded poly when I
printed it out to the screen, so the quotes are being concatenated to
the string in the array entry.
Thanks for your reply
Jeff
On Nov 2, 8:27 am, "maps.huge.info [Maps API Guru]" <cor...@gmail.com>
wrote:
On Nov 2, 6:44 am, Jeff <jeff.ti...@gmail.com> wrote:
> If this is what you mean, I tried substituting ' " ... " ' for
> "\" ... \""; in the array entries but that didn't work; no spaces
> between single and double quote - I just typed in this response for
> clarity.
> I'm googling for explanations on why double escaping would work. The
> original quote did correctly show the "..." in the encoded poly when I
> printed it out to the screen, so the quotes are being concatenated to
> the string in the array entry.
> Thanks for your reply
My browser complains about this line:
var point = new pointZ[ i ];
> On Nov 2, 6:44 am, Jeff <jeff.ti...@gmail.com> wrote:
> > If this is what you mean, I tried substituting ' " ... " ' for
> > "\" ... \""; in the array entries but that didn't work; no spaces
> > between single and double quote - I just typed in this response for
> > clarity.
> > I'm googling for explanations on why double escaping would work. The
> > original quote did correctly show the "..." in the encoded poly when I
> > printed it out to the screen, so the quotes are being concatenated to
> > the string in the array entry.
> > Thanks for your reply
> My browser complains about this line:
> var point = new pointZ[ i ];
> It doesn't know what to do with "new pointZ[i]"
Fixing that, double encoding the "\" in the encoded polylines and
zooming out let see everything. BTW, the blue icons are "squished",
you don't have the size set correctly for them.
On Nov 2, 3:44 pm, Jeff <jeff.ti...@gmail.com> wrote:
> If this is what you mean, I tried substituting ' " ... " ' for
> "\" ... \""; in the array entries but that didn't work;
No. Backslashes are escape characters, and therefore they need to be
escaped themselves, so that they function as a regular character, and
not as an escape character.
So, '\' needs to become '\\', and
> no spaces
> between single and double quote - I just typed in this response for
> clarity.
> I'm googling for explanations on why double escaping would work. The
> original quote did correctly show the "..." in the encoded poly when I
> printed it out to the screen, so the quotes are being concatenated to
> the string in the array entry.
> Thanks for your reply
> Jeff
> On Nov 2, 8:27 am, "maps.huge.info [Maps API Guru]" <cor...@gmail.com>
> wrote:
> > Have you tried double escaping your backslashes? (\\)
> > Have you tried using a combination of single and double quotes instead
> > of escaping your quotes?
> On Nov 2, 6:44 am, Jeff <jeff.ti...@gmail.com> wrote:
> > If this is what you mean, I tried substituting ' " ... " ' for
> > "\" ... \""; in the array entries but that didn't work; no spaces
> > between single and double quote - I just typed in this response for
> > clarity.
> > I'm googling for explanations on why double escaping would work. The
> > original quote did correctly show the "..." in the encoded poly when I
> > printed it out to the screen, so the quotes are being concatenated to
> > the string in the array entry.
> > Thanks for your reply
> My browser complains about this line:
> var point = new pointZ[ i ];
> It doesn't know what to do with "new pointZ[i]"
> -- Larry
> > On Nov 2, 8:27 am, "maps.huge.info [Maps API Guru]" <cor...@gmail.com>
> > wrote:
> > > Have you tried double escaping your backslashes? (\\)
> > > Have you tried using a combination of single and double quotes instead
> > > of escaping your quotes?
The array of encoded polylines doesn't really need to have a backslash
in it, right?
My original thought was to have each polyline as an array entry along
with " " which - for the first responder's suggestion, I believe I now
have by adding ' " ... " '; around each encoded polyline entry.
If that is correct (and I don't have nor need backslashes), then I'm
stumped on the function call.
The encoded polyline API requires the parameter to be in a string in
quotes (I'm pretty sure I'm not telling you something you don't
already know! Please forgive me as I'm trying to set-up the question):
var encodedPolyline = new GPolyline.fromEncoded ({
...
points: "iygwDrnmvQxzCldE|r@fCrqC~lE`_CnyCxMvfF",
levels: "BBBBBB",
zoomFactor ...
});
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 ],
I'm concerned I'm missing a more fundamental point in the suggestions
for double-escapes.
Jeff
On Nov 2, 10:18 am, Marcelo <marcelo...@hotmail.com> wrote:
> On Nov 2, 3:44 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > If this is what you mean, I tried substituting ' " ... " ' for
> > "\" ... \""; in the array entries but that didn't work;
> No. Backslashes are escape characters, and therefore they need to be
> escaped themselves, so that they function as a regular character, and
> not as an escape character.
> So, '\' needs to become '\\', and
> > no spaces
> > between single and double quote - I just typed in this response for
> > clarity.
> > I'm googling for explanations on why double escaping would work. The
> > original quote did correctly show the "..." in the encoded poly when I
> > printed it out to the screen, so the quotes are being concatenated to
> > the string in the array entry.
> > Thanks for your reply
> > Jeff
> > On Nov 2, 8:27 am, "maps.huge.info [Maps API Guru]" <cor...@gmail.com>
> > wrote:
> > > Have you tried double escaping your backslashes? (\\)
> > > Have you tried using a combination of single and double quotes instead
> > > of escaping your quotes?
On Nov 2, 5:31 pm, Jeff <jeff.ti...@gmail.com> wrote:
> Hello - Thank you for helping.
> The array of encoded polylines doesn't really need to have a backslash
> in it, right?
No. The backslash is one of the many characters used by encoded
polylines. The characters used are ASCII 63 to 127, and the backslash
is 92, so if the encoding algorithm put a backslash there, then it
needs to be there.
Because the backslash is an escape character, you need to escape it,
so that it doesn't act as an escape character, but as a normal one.
> My original thought was to have each polyline as an array entry along
> with " " which - for the first responder's suggestion, I believe I now
> have by adding ' " ... " '; around each encoded polyline entry.
> If that is correct (and I don't have nor need backslashes), then I'm
> stumped on the function call.
> The encoded polyline API requires the parameter to be in a string in
> quotes (I'm pretty sure I'm not telling you something you don't
> already know! Please forgive me as I'm trying to set-up the question):
> var encodedPolyline = new GPolyline.fromEncoded ({
> ...
> points: "iygwDrnmvQxzCldE|r@fCrqC~lE`_CnyCxMvfF",
> levels: "BBBBBB",
> zoomFactor ...
> });
> 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 ],
> I'm concerned I'm missing a more fundamental point in the suggestions
> for double-escapes.
> Jeff
> On Nov 2, 10:18 am, Marcelo <marcelo...@hotmail.com> wrote:
> > On Nov 2, 3:44 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > > If this is what you mean, I tried substituting ' " ... " ' for
> > > "\" ... \""; in the array entries but that didn't work;
> > No. Backslashes are escape characters, and therefore they need to be
> > escaped themselves, so that they function as a regular character, and
> > not as an escape character.
> > So, '\' needs to become '\\', and
> > > no spaces
> > > between single and double quote - I just typed in this response for
> > > clarity.
> > > I'm googling for explanations on why double escaping would work. The
> > > original quote did correctly show the "..." in the encoded poly when I
> > > printed it out to the screen, so the quotes are being concatenated to
> > > the string in the array entry.
> > > Thanks for your reply
> > > Jeff
> > > On Nov 2, 8:27 am, "maps.huge.info [Maps API Guru]" <cor...@gmail.com>
> > > wrote:
> > > > Have you tried double escaping your backslashes? (\\)
> > > > Have you tried using a combination of single and double quotes instead
> > > > of escaping your quotes?
On Nov 2, 4:31 pm, Jeff <jeff.ti...@gmail.com> 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.
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|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 = pointZ[ i ];
map.addOverlay(new GMarker(point, markerOptions));
}
// GEvent.addDomListener( window, 'load', map2_initialize );
On Nov 2, 10:48 am, Andrew Leach <andrew.leac...@googlemail.com>
wrote:
> On Nov 2, 4:31 pm, Jeff <jeff.ti...@gmail.com> 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.
On Nov 2, 5:16 pm, Jeff <jeff.ti...@gmail.com> wrote:
> 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).
Why do you have escaped quotes in the strings? The strings of
characters must not contain quotes, only valid characters.
To get a Javascript string containing the characters ABCDEFG, you put
that in quotes, either single or double. These are equivalent, and
contain strings of seven characters:
var mystring= "ABCDEFG";
var mystring= 'ABCDEFG';
That is not the same as these, which are also equivalent:
var mystring="'ABCDFEG'"
var mystring="\'ABCDEFG\'"
because in these statements, the strings really contain the quote
characters. The strings are nine characters long.
Regarding the levels string, Google's example page, encoding function
and documentation are (ahem) sub-standard. Prof McClure's is far
better and produces results which do the job that encoding is intended
to do.
Andrew - thank you! My mistake was in confusing the array string
declaration as you noted - didn't need to be enclosed in quotes. I
removed the escaped quotes and now see multiple polylines displayed.
Thanks to all (and especially to the original responder John who had
tried to gently guide me down the right path based on missing the
escaped backslashes in the points).
And yes, the references you guys provided were very helpful beyond the
original documentation.
I appreciate it,
Jeff
On Nov 2, 11:30 am, Andrew Leach <andrew.leac...@googlemail.com>
wrote:
> On Nov 2, 5:16 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > 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).
> Why do you have escaped quotes in the strings? The strings of
> characters must not contain quotes, only valid characters.
> To get a Javascript string containing the characters ABCDEFG, you put
> that in quotes, either single or double. These are equivalent, and
> contain strings of seven characters:
> var mystring= "ABCDEFG";
> var mystring= 'ABCDEFG';
> That is not the same as these, which are also equivalent:
> var mystring="'ABCDFEG'"
> var mystring="\'ABCDEFG\'"
> because in these statements, the strings really contain the quote
> characters. The strings are nine characters long.
> Regarding the levels string, Google's example page, encoding function
> and documentation are (ahem) sub-standard. Prof McClure's is far
> better and produces results which do the job that encoding is intended
> to do.
> Andrew - thank you! My mistake was in confusing the array string
> declaration as you noted - didn't need to be enclosed in quotes. I
> removed the escaped quotes and now see multiple polylines displayed.
> Thanks to all (and especially to the original responder John who had
> tried to gently guide me down the right path based on missing the
> escaped backslashes in the points).
> And yes, the references you guys provided were very helpful beyond the
> original documentation.
> I appreciate it,
> Jeff
> On Nov 2, 11:30 am, Andrew Leach <andrew.leac...@googlemail.com>
> wrote:
> > On Nov 2, 5:16 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > > 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).
> > Why do you have escaped quotes in the strings? The strings of
> > characters must not contain quotes, only valid characters.
> > To get a Javascript string containing the characters ABCDEFG, you put
> > that in quotes, either single or double. These are equivalent, and
> > contain strings of seven characters:
> > var mystring= "ABCDEFG";
> > var mystring= 'ABCDEFG';
> > That is not the same as these, which are also equivalent:
> > var mystring="'ABCDFEG'"
> > var mystring="\'ABCDEFG\'"
> > because in these statements, the strings really contain the quote
> > characters. The strings are nine characters long.
> > Regarding the levels string, Google's example page, encoding function
> > and documentation are (ahem) sub-standard. Prof McClure's is far
> > better and produces results which do the job that encoding is intended
> > to do.
> On Nov 2, 11:41 am, Jeff <jeff.ti...@gmail.com> wrote:
> > Andrew - thank you! My mistake was in confusing the array string
> > declaration as you noted - didn't need to be enclosed in quotes. I
> > removed the escaped quotes and now see multiple polylines displayed.
> > Thanks to all (and especially to the original responder John who had
> > tried to gently guide me down the right path based on missing the
> > escaped backslashes in the points).
> > And yes, the references you guys provided were very helpful beyond the
> > original documentation.
> > I appreciate it,
> > Jeff
> > On Nov 2, 11:30 am, Andrew Leach <andrew.leac...@googlemail.com>
> > wrote:
> > > On Nov 2, 5:16 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > > > 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).
> > > Why do you have escaped quotes in the strings? The strings of
> > > characters must not contain quotes, only valid characters.
> > > To get a Javascript string containing the characters ABCDEFG, you put
> > > that in quotes, either single or double. These are equivalent, and
> > > contain strings of seven characters:
> > > var mystring= "ABCDEFG";
> > > var mystring= 'ABCDEFG';
> > > That is not the same as these, which are also equivalent:
> > > var mystring="'ABCDFEG'"
> > > var mystring="\'ABCDEFG\'"
> > > because in these statements, the strings really contain the quote
> > > characters. The strings are nine characters long.
> > > Regarding the levels string, Google's example page, encoding function
> > > and documentation are (ahem) sub-standard. Prof McClure's is far
> > > better and produces results which do the job that encoding is intended
> > > to do.
Yes it is, for now. BTW, it looks like v3 doesn't use encoded
polylines, but instead uses arrays of points comprising a polyline.
I'm very new at this - just started looking 2 days ago and completed
my first map with the help of this group yesterday - is it likely that
google will maintain encoded polylines in v3 or has it definitely been
left behind? Also, how long should I assume v2 API to be supported/
allowed before having to redo this map.
Thanks again for your help!
Jeff
On Nov 2, 9:52 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> Looks to me like you have a default (red) marker over top of a
> (smaller) blue marker. Is that on purpose?
> -- Larry
> > On Nov 2, 11:41 am, Jeff <jeff.ti...@gmail.com> wrote:
> > > Andrew - thank you! My mistake was in confusing the array string
> > > declaration as you noted - didn't need to be enclosed in quotes. I
> > > removed the escaped quotes and now see multiple polylines displayed.
> > > Thanks to all (and especially to the original responder John who had
> > > tried to gently guide me down the right path based on missing the
> > > escaped backslashes in the points).
> > > And yes, the references you guys provided were very helpful beyond the
> > > original documentation.
> > > I appreciate it,
> > > Jeff
> > > On Nov 2, 11:30 am, Andrew Leach <andrew.leac...@googlemail.com>
> > > wrote:
> > > > On Nov 2, 5:16 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > > > > 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).
> > > > Why do you have escaped quotes in the strings? The strings of
> > > > characters must not contain quotes, only valid characters.
> > > > To get a Javascript string containing the characters ABCDEFG, you put
> > > > that in quotes, either single or double. These are equivalent, and
> > > > contain strings of seven characters:
> > > > var mystring= "ABCDEFG";
> > > > var mystring= 'ABCDEFG';
> > > > That is not the same as these, which are also equivalent:
> > > > var mystring="'ABCDFEG'"
> > > > var mystring="\'ABCDEFG\'"
> > > > because in these statements, the strings really contain the quote
> > > > characters. The strings are nine characters long.
> > > > Regarding the levels string, Google's example page, encoding function
> > > > and documentation are (ahem) sub-standard. Prof McClure's is far
> > > > better and produces results which do the job that encoding is intended
> > > > to do.
On Nov 3, 6:15 am, Jeff <jeff.ti...@gmail.com> wrote:
> Yes it is, for now. BTW, it looks like v3 doesn't use encoded
> polylines, but instead uses arrays of points comprising a polyline.
> I'm very new at this - just started looking 2 days ago and completed
> my first map with the help of this group yesterday - is it likely that
> google will maintain encoded polylines in v3 or has it definitely been
> left behind?
> Also, how long should I assume v2 API to be supported/
> allowed before having to redo this map.
> Thanks again for your help!
> Jeff
> On Nov 2, 9:52 pm, "geocode...@gmail.com" <geocode...@gmail.com>
> wrote:
> > On Nov 2, 7:40 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > > Here is my "final" in case anyone is interested later. I'm also
> > > interested in hearing from others who may be doing similar maps.
> > > Jeff
> > Looks to me like you have a default (red) marker over top of a
> > (smaller) blue marker. Is that on purpose?
> > -- Larry
> > > On Nov 2, 11:41 am, Jeff <jeff.ti...@gmail.com> wrote:
> > > > Andrew - thank you! My mistake was in confusing the array string
> > > > declaration as you noted - didn't need to be enclosed in quotes. I
> > > > removed the escaped quotes and now see multiple polylines displayed.
> > > > Thanks to all (and especially to the original responder John who had
> > > > tried to gently guide me down the right path based on missing the
> > > > escaped backslashes in the points).
> > > > And yes, the references you guys provided were very helpful beyond the
> > > > original documentation.
> > > > I appreciate it,
> > > > Jeff
> > > > On Nov 2, 11:30 am, Andrew Leach <andrew.leac...@googlemail.com>
> > > > wrote:
> > > > > On Nov 2, 5:16 pm, Jeff <jeff.ti...@gmail.com> wrote:
> > > > > > 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).
> > > > > Why do you have escaped quotes in the strings? The strings of
> > > > > characters must not contain quotes, only valid characters.
> > > > > To get a Javascript string containing the characters ABCDEFG, you put
> > > > > that in quotes, either single or double. These are equivalent, and
> > > > > contain strings of seven characters:
> > > > > var mystring= "ABCDEFG";
> > > > > var mystring= 'ABCDEFG';
> > > > > That is not the same as these, which are also equivalent:
> > > > > var mystring="'ABCDFEG'"
> > > > > var mystring="\'ABCDEFG\'"
> > > > > because in these statements, the strings really contain the quote
> > > > > characters. The strings are nine characters long.
> > > > > Regarding the levels string, Google's example page, encoding function
> > > > > and documentation are (ahem) sub-standard. Prof McClure's is far
> > > > > better and produces results which do the job that encoding is intended
> > > > > to do.
On Nov 3, 4:15 pm, Jeff <jeff.ti...@gmail.com> wrote:
> Yes it is, for now. BTW, it looks like v3 doesn't use encoded
> polylines, but instead uses arrays of points comprising a polyline.
> I'm very new at this - just started looking 2 days ago and completed
> my first map with the help of this group yesterday - is it likely that
> google will maintain encoded polylines in v3 or has it definitely been
> left behind?
No, it has not been left behind. v3 driving directions use encoded
polylines with the same encoding algorithm.