[pmwiki-users] Announcement: Google Map API v.2.0.0--Hot off the press

Hans design5 at softflow.co.uk
Thu Aug 24 06:35:39 CDT 2006


And back to the topic of the GoggleMapAPI recipe:

Ben,

as I said before I don't like the way that a point is required to
center the map. It runs counter to google's own function for map
creation. I think a map should be centered with providing lat and lon
inside the map markup, not a point. Very little change is necessary to
achieve this, and subsequently markers will show as well:

I suggested these changes (tried them out):
In the main gmap.php file:

add to $GmapDefaults:
      'lat' => 0,
      'lon' => 0,

add to function GmaMap:
      $this->clat = $GmaDefaults['clat'];
      $this->clng = $GmaDefaults['clng'];

add to function gmaCleanup:
  $clat = $GmaMap->clat;
  $clng = $GmaMap->clng;

in the $GmaScript variable change:
   // setGmaMapCenter($map_id, $view, $zoom);
    $map_id.setCenter(new GLatLng($clat, $clng), $zoom, $view);

in function gmaMarkup   case ('map'):
add:
    if ($opts['lat']) $GmaMap->clat = $opts['lat'];
    if ($opts['lon']) $GmaMap->clng = $opts['lon'];

This allows use of lat= and lon= options for the map markup,
in the javascript used as clat and clng.
and points (markers) show up when specified with the points markup.

See example here on my site:
http://softflow.co.uk/design/Maps/FindhornBay

thanks for changing the docu!
examples much appriciated!

regards,
 Hans

(Changed email away from googlemail)





More information about the pmwiki-users mailing list