![Smarty Forum Index Smarty Forum Index](templates/smarty/images/phpbb2_logo.gif) |
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 |
drakos7 Smarty n00b
Joined: 12 Dec 2006 Posts: 2
|
Posted: Tue Dec 12, 2006 5:25 pm Post subject: Google Maps API issues adding icons |
|
|
In function getMapJS() I am getting a couple errors the first time through the icons loop when I am using addMarkerIcon. Line 907 Code: | if(!is_numeric($exist_icn[$icon_key])) {
$exist_icn[$icon_key] = $i; |
Shouldn't the "is_numeric" be an "isset" instead? Otherwise it is trying to look up an undefined array element (the MD5 hash of the icon). By switching to "isset", one does not have to instantiate the $exist_icn either.
Also, using the firefox extension 'html validator' I found a lot of spots in the code where the closing tags sent to javascript should be escaped. But that is a minor issue.
Last edited by drakos7 on Tue Dec 12, 2006 5:32 pm; edited 1 time in total |
|
Back to top |
|
drakos7 Smarty n00b
Joined: 12 Dec 2006 Posts: 2
|
Posted: Tue Dec 12, 2006 5:28 pm Post subject: |
|
|
I forgot to mention that in the same function
Code: | for($i = 0; $this->_icons[$i]; $i++) { |
generates an Undefined offset error also on line 902. |
|
Back to top |
|
nmweb Smarty n00b
Joined: 29 Dec 2006 Posts: 2
|
Posted: Fri Dec 29, 2006 6:45 pm Post subject: |
|
|
drakos7 wrote: | I forgot to mention that in the same function
Code: | for($i = 0; $this->_icons[$i]; $i++) { |
generates an Undefined offset error also on line 902. |
I fixed this by
Code: | for($i = 0; $i<count($this->_icons); $i++) { | putting this instead. Now the loop actually loops till he reaches the end of array $this->_icons.
Hope it helps anyone
edit: improved code |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue May 01, 2007 8:29 pm Post subject: |
|
|
These changes are committed to CVS, thanks! |
|
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
|