Hi all,

I have a GMAP question that has bugging me for some time. How do i draw a static line on a google map generated using views.

I generated views which through views panes i'm using on panel pages. The views are successfully used to draw markers. See the map on the front page of www.jamorph.com

I need to add a static line, which should be straight forward, but no matter how hard i tried i had no success.

If instead i build the map using GMap macro this works fine and have my line.

http://www.jamorph.com/blogstar/node/217

But i need to draw the line in the map created by gmap_views.module.

Any suggestions?

Marco.

Comments

mm167’s picture

from the gmap doc, u may add lines using the following macro

line = line color in hex/line width in pixels/line percent opacity:lat1,lon1 + lat2,lon2 + … + latN,lonN

can u give us more details of your problem?

if u are using gmap filter to add gmap into your content, what is the gmap macro?

I saw there's a line in one of your maps..so, what exactly is your question?

dreamconverter’s picture

I have two maps, one is generated with GMap Macro and it correctly displays the line.
The other is generated using GMap views. The gmap_views.module correctly retrieves the nodes that have lat and lon in their CCK latitude and longitude fields and creates the map with the markers but now I want to add a line to the map generated by this view. What code do i need to write?

I tried to add this code to gmap_views.module but it does not work.

$myshapes=array(array('color' => '#00dd00',
                      'type'=>'line',
                      'opacity' => '0.5',
                      'points' => array( array('latitude'=>'49.19011831503412','longitude'=>'- 123.20737838745117'),
                                        array('latitude'=>'0.18506953036687','longitude'=>'-0.16274642944336'))),
                array('color' => '#00dd00',
                      'opacity' => '0.5',
                      'type'=>'line',
                      'points' => array(array('latitude'=>'25.20526157803394','longitude'=>'-123.19965362548828'),
                                       array('latitude'=>'49.20077516864678','longitude'=>'-20.16102981567383'))));
$thismap['#settings']['shapes'][] = $myshapes;
strands’s picture

The code should go into the Arguments Handling Code area in Drupal 5 in this format:

$view->gmap_macro = "[<gmap macro code goes here>]";