|
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 |
croakingtoad Smarty n00b
Joined: 12 Mar 2010 Posts: 1
|
Posted: Fri Mar 12, 2010 3:41 pm Post subject: Google Map possible if you can't call JS between <head> |
|
|
Greetings,
Because of the way my CMS is set up, I am not able to insert the JS between the <head> tags because the dynamic values of my addresses don't get loaded until later in the page. So in order to make this work, I need to load my JS later and what I have done is this:
Code: |
<body>
<?php
<!-- MUCH OTHER CODE -->
// Pull in Google Maps class file
require_once('/home/foo/public_html/wp-content/themes/foo-home/assets/php/GoogleMapAPI.class.php');
$map = new GoogleMapAPI('map1');
$map->disableOnLoad();
//$map->setDSNgoog('mysql://foo:bar@localhost/foo_geocodes');
$map->setAPIKey('foo');
$map->addMarkerByAddress('621 N 48th St # 6 Lincoln NE 68502','PJ Pizza','<b>PJ Pizza</b>');
$map->printHeaderJS();
$map->printMapJS();
$map->printMap();
$map->printOnLoad();
?>
<!-- OTHER CODE -->
</body>
|
But all that happens is I get a space for the map in my layout but no map. Can someone advise what I'm doing wrong or even if this is possible? |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 12, 2010 3:50 pm Post subject: |
|
|
1) check the browser source, see that you are getting exactly the HTML/JS output you are expecting.
2) check javascript console for errors
3) spot check javascript, make sure vars have values you expect.
It's not always simple to pinpoint. Check file system paths, if you have any. That is the usual suspect. |
|
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
|