Some directions display questions

1,702 views
Skip to first unread message

WebEngineer

unread,
Sep 24, 2010, 11:52:34 AM9/24/10
to Google Maps JavaScript API v3
I am a newbie working on a map system for my web site at www.Violette.com.
We are traveling in our motorhome and I want to display two tracks:
the one we have followed and the one we plan. Each track consists of
several waypoints; the routes must go through each waypoint but
markers are only placed at points shown as 'stop' in the record.

See my test at http://www.Violette.com/TestMap.aspx. I have some
questions:

1. Why does each route ignore the next-to-last waypoint and how to fix
this?
2. Why does each route only show a leg from the two-from-last waypoint
to the last waypoint and how to fix this?
3. How can I make the polyline for each route use the polylineOptions
for strokeColor and strokeWeight instead of showing a black line of
the same weight? If I do not specify polylineOptions the lines are
blue and #2 is avoided but #1 still applies.
4. Is there a polylineOption for line types other than solid (e.g.:
dashed)?

Thanks for any help!!
Dave

geoco...@gmail.com

unread,
Sep 24, 2010, 12:22:42 PM9/24/10
to Google Maps JavaScript API v3
On Sep 24, 8:52 am, WebEngineer <davidaviole...@gmail.com> wrote:
> I am a newbie working on a map system for my web site atwww.Violette.com.
> We are traveling in our motorhome and I want to display two tracks:
> the one we have followed and the one we plan. Each track consists of
> several waypoints; the routes must go through each waypoint but
> markers are only placed at points shown as 'stop' in the record.
>
> See my test at

http://www.Violette.com/TestMap.aspx

I get javascript errors:
Line: 1
Error: 'Black' is undefined

This file cannot be accessed publicly:
http://www.violette.com/MapFiles/Fall2010.kml

> I have some questions:
>
> 1. Why does each route ignore the next-to-last waypoint and how to fix
> this?
> 2. Why does each route only show a leg from the two-from-last waypoint
> to the last waypoint and how to fix this?

Probably caused by the javascript error. Although I don't see any
attempts to use the directions service on your map.

> 3. How can I make the polyline for each route use the polylineOptions
> for strokeColor and strokeWeight instead of showing a black line of
> the same weight? If I do not specify polylineOptions the lines are
> blue and #2 is avoided but #1 still applies.

You should be able to use whatever polylineOptions you want.

> 4. Is there a polylineOption for line types other than solid (e.g.:
> dashed)?

No.

-- Larry

David Violette

unread,
Sep 24, 2010, 12:44:07 PM9/24/10
to google-map...@googlegroups.com
Larry:
You must have received a different (old) version of TestMap because there is no reference to Fall2010.kml in the current one and Black is not used. To help avoid caching problems I have uploaded a new file as Violette.com/TestMap2.aspx.

TestMap2 does use directions service.

Thanks on #4.
TestMap2 should help with #1-3.

Thanks,
Dave

--
You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group.
To post to this group, send email to google-map...@googlegroups.com.
To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.


geoco...@gmail.com

unread,
Sep 24, 2010, 1:39:25 PM9/24/10
to Google Maps JavaScript API v3
On Sep 24, 9:44 am, David Violette <davidaviole...@gmail.com> wrote:
> Larry:
> You must have received a different (old) version of TestMap because there is
> no reference to Fall2010.kml in the current one and Black is not used. To
> help avoid caching problems I have uploaded a new file as
> Violette.com/TestMap2.aspx.
>
> TestMap2 does use directions service.

I get errors on that map as well:
Line: 145
Error: '4' is null or not an object

on this line:
var isStop = spotPlace[4];

Which may explain your problems.

This entry in your TripMarkersActual is not the same as the others:
['Silver Springs NV', 39.4161922, -119.224832, 3, 'via', '', '',
''],

-- Larry

>
> Thanks on #4.
> TestMap2 should help with #1-3.
>
> Thanks,
> Dave
>
> On Fri, Sep 24, 2010 at 9:22 AM, geocode...@gmail.com
> <geocode...@gmail.com>wrote:
> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­unsub...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.- Hide quoted text -
>
> - Show quoted text -

geoco...@gmail.com

unread,
Sep 24, 2010, 1:57:28 PM9/24/10
to Google Maps JavaScript API v3
On Sep 24, 10:39 am, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Sep 24, 9:44 am, David Violette <davidaviole...@gmail.com> wrote:
>
> > Larry:
> > You must have received a different (old) version of TestMap because there is
> > no reference to Fall2010.kml in the current one and Black is not used. To
> > help avoid caching problems I have uploaded a new file as
> > Violette.com/TestMap2.aspx.
>
> > TestMap2 does use directions service.
>
> I get errors on that map as well:
> Line: 145
> Error: '4' is null or not an object
>
> on this line:
> var isStop = spotPlace[4];
>
> Which may explain your problems.
>
> This entry in your TripMarkersActual is not the same as the others:
>     ['Silver Springs NV', 39.4161922, -119.224832, 3, 'via', '', '',
> ''],

polyOptionsActual and polyOptionsPlan should be polylineOptions
anonymous objects, not Polylines.

Javascript Object properties are case sensitive:
so not:
strokecolor: '#FF0000',
strokeopacity: 1.0,
strokeweight: 10
use:
strokeColor: '#FF0000',
strokeOpacity: 1.0,
strokeWeight: 10
> > >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

David Violette

unread,
Sep 24, 2010, 8:31:01 PM9/24/10
to google-map...@googlegroups.com
Larry:

Many thanks for your help. I have now solved the polylineOptions issue and corrected the problem throwing the error.

I still have the problem with the DirectionsRenderer not displaying all legs in the route when I use the polylineOptions. In the http://TestMap3.aspx version I have the Actual route rendered using no polylineOptions, and the Plan route using polylineOptions. You will see that all legs of the Actual route are rendered while only the last one of the Plan route is rendered. What do I need to do to fix that?

Dave

To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.

geoco...@gmail.com

unread,
Sep 25, 2010, 2:34:07 AM9/25/10
to Google Maps JavaScript API v3
On Sep 24, 5:31 pm, David Violette <davidaviole...@gmail.com> wrote:
> Larry:
>
> Many thanks for your help. I have now solved the polylineOptions issue and
> corrected the problem throwing the error.
>
> I still have the problem with the DirectionsRenderer not displaying all legs
> in the route when I use the polylineOptions. In thehttp://TestMap3.aspxversionI have the Actual route rendered using no
> polylineOptions, and the
> Plan route using polylineOptions. You will see that all legs of the Actual
> route are rendered while only the last one of the Plan route is rendered.
> What do I need to do to fix that?

I have a local version working, I will post it when I get a chance.
You are still making you polylineOptions as google.maps.Polyline
objects, not anonymous polylineOptions objects.

-- Larry

> Dave
>
> On Fri, Sep 24, 2010 at 10:57 AM, geocode...@gmail.com <geocode...@gmail.com
> > > > >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hidequotedtext -
>
> > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To post to this group, send email to
> > google-map...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­unsub...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-maps-js-api-v3?hl=en.- Hide quoted text -

geoco...@gmail.com

unread,
Sep 25, 2010, 10:35:31 AM9/25/10
to Google Maps JavaScript API v3
On Sep 24, 11:34 pm, "geocode...@gmail.com" <geocode...@gmail.com>
wrote:
> On Sep 24, 5:31 pm, David Violette <davidaviole...@gmail.com> wrote:
>
> > Larry:
>
> > Many thanks for your help. I have now solved the polylineOptions issue and
> > corrected the problem throwing the error.
>
> > I still have the problem with the DirectionsRenderer not displaying all legs
> > in the route when I use the polylineOptions. In thehttp://TestMap3.aspxversionIhave the Actual route rendered using no
> > polylineOptions, and the
> > Plan route using polylineOptions. You will see that all legs of the Actual
> > route are rendered while only the last one of the Plan route is rendered.
> > What do I need to do to fix that?
>
> I have a local version working, I will post it when I get a chance.

http://www.geocodezip.com/violette_com_TestMap2c.html

-- Larry
> > > > > >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hidequote...-
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -
>
> > > --
> > > You received this message because you are subscribed to the Google Groups
> > > "Google Maps JavaScript API v3" group.
> > > To post to this group, send email to
> > > google-map...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > google-maps-js-a...@googlegroups.com<google-maps-js-api-v3%2B­­unsub...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-maps-js-api-v3?hl=en.-Hide quoted text -

David Violette

unread,
Sep 25, 2010, 8:46:48 PM9/25/10
to google-map...@googlegroups.com
Many thanks, Larry!!

You not only helped me solve the original problems you also showed me via your marked-up version a method for tracking a javascript operation to see what is happening! A real bonus for me. While I have many years of ASP.NET/VB.NET progrramming I have done little in javascript until recently.

I have it working now as desired at Violette.com. (You can follow our travels there as well)

Dave

To unsubscribe from this group, send email to google-maps-js-a...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages