|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
smuddy Smarty n00b
Joined: 28 Sep 2009 Posts: 1
|
Posted: Mon Sep 28, 2009 1:43 pm Post subject: [GoogleMapAPI] Adding marker to a different position |
|
|
hello,
i'm using the GoogleMapAPI library.
right now, i place a marker with an address like
**
addMarkerByAddress('3457 Holdrege St Lincoln NE
68502',"Valentino's","<b>Valentino's</b>");
**
and this gets centered. i have a 900x300 pixel large map and want to
place the marker on the very right side (800) instead of the center.
does anyone have an idea on how to do that? |
|
Back to top |
|
jordanfarrow Smarty n00b
Joined: 08 Oct 2009 Posts: 1
|
Posted: Thu Oct 08, 2009 4:39 pm Post subject: |
|
|
Smuddy,
You can call adjustCenterCoords($lon, $lat) after you've added your markers:
$map->adjustCenterCoords($new_lon, $new_lat);
Where $new_lon and $new_lat are where you want the center to be. You can keep the lat the same as your original address, and just subtract a variable amount off the original lon (depends on the zoom level).
Hope that helps.
Jordan |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|