Marker with directions PDF Print E-mail
Written by Mike Reumer   
Saturday, 06 August 2011 00:00

This demo shows how to place an address as a parameter so the marker will show based on the address with a directions form. With this form the visitor can get directions to your location.
You can avoid highways, walking option or direction on map itself. For it's parameters see: Directions on map.

Dir can be:

  • 0 No directions
  • 1 New window/tab with maps.google.com with directions
  • 2 New window/tab with directions in print version
  • 5 Directions on the map itself (Not with kml file rendered with geoxml)

The following options are disabled by google (no embedding allowed of google websites):

  • 3 Lightbox with directions in print version (Not kml-file rendered with geoxml)
  • 4 Lightbox with maps.google.com with directions (Not with kml file rendered with geoxml)

The following parameters can be used:

  • dirtype - If walking or driving directions should be shown
    • D - Driving
    • W - Walking
  • avoidhighways - Attempt to exclude highways when computing directions. Note that directions may still include highways if there are no viable alternatives, use 1 (default 0)
  • diroptimize - Specifies that the route using the supplied waypoints may be optimized to provide the shortest possible route so waypoints are reordered, use 1 (default 0).
  • diralternatives - Specifies that alternative routes may shown and can be chosen. Note that providing route alternatives may increase the response time from the server, use 1 (default 0).
  • showdir - Show route information for directions (use 1) or not (use 0).

To show the above options in the form, you must set the label of the parameter in the configuration of the plugin or use the necessary parameters, for example txt_alternatives='Alternatives'.

Open maps.google.com in a new window/tab:

{mosmap address='street, zipcode place,  country'|dir='1'}

Also possible to open directions in a new window/tab:

{mosmap text='<div><div>hallo</div></div>'|address='de Tocht 4, 2731 CJ Benthuizen, The Netherlands'|dir='2'}

Also possible to open the route on the map itself:

{mosmap text='<div><div>hallo</div></div>'|address='de Tocht 4, 2731 CJ Benthuizen, The Netherlands'|dir='5'}

With showdir you can show or not show the directions below the map:

{mosmap text='<div><div>hallo</div></div>'|address='de Tocht 4, 2731 CJ Benthuizen, The Netherlands'|dir='5'|showdir='0'}

You can style the directions, see: Changing direction form style.

Last Updated on Saturday, 19 May 2012 21:15
 

Advertisement