Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

[GoogleMapAPI] Adding marker to a different position

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
smuddy
Smarty n00b


Joined: 28 Sep 2009
Posts: 1

PostPosted: Mon Sep 28, 2009 1:43 pm    Post subject: [GoogleMapAPI] Adding marker to a different position Reply with quote

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
View user's profile Send private message
jordanfarrow
Smarty n00b


Joined: 08 Oct 2009
Posts: 1

PostPosted: Thu Oct 08, 2009 4:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Add-ons All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP