Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

[GoogleMapAPI] Multiple Maps

 
Post new topic   Reply to topic    Smarty Forum Index -> Add-ons
View previous topic :: View next topic  
Author Message
mcalsada
Smarty n00b


Joined: 17 Oct 2009
Posts: 1

PostPosted: Sat Oct 17, 2009 7:59 pm    Post subject: [GoogleMapAPI] Multiple Maps Reply with quote

The docs say you can define multiple map instances. How do you get them to work?

If you use the following for each map object that is created, the JS is just duplicated and creates multiple copies of the onLoad event.

$map = new GoogleMapAPI('map_0','');
$map->setAPIKey(GMAP_KEY);
/* Set Markers, polylines, other options */
$map->printMapJS();
$map->printOnLoad();

$map2 = new GoogleMapAPI('map_1','');
$map2->setAPIKey(GMAP_KEY);
/* Set Markers, polylines, other options */
$map2->printMapJS();
$map2->printOnLoad();
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    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