|
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 |
wessite Smarty Rookie
Joined: 21 Mar 2007 Posts: 6
|
Posted: Thu Jan 10, 2008 9:35 am Post subject: googlemaps api 2.5 html |
|
|
Hello,
I am using the api quite a while now and I have a bit over 500 markers on my entire map.
The load time is pretty long now so I made a select by country, and I am trying to reduce the html in the createmarker().
The question is what is the use of all the backslashes in the html code ?
because this is making the html almost double...
example:
Code: | var marker = createMarker(point,"Bicross Club Soumagne","<div class=\"infowindow\"><div class=\"flag\"><img src=\"\/nucleus\/plugins\/googlemaps\/flags\/be.gif\" alt=\"\" \/><\/div><h2><a href=\"http:\/\/www.bmxaction.net\/item\/bicross-club-soumagne\">Bicross Club Soumagne<\/a><\/h2><b><ul><li><a onclick=\"zoomMarker(16);\" title=\"Zoom In\"><img src=\"\/images\/zoom.gif\" alt=\"\"><\/a><\/li><li><a onclick=\"zoomMarker(2);\" title=\"Zoom Out\"><img src=\"\/images\/zoom-out.gif\" alt=\"\"><\/a><\/li><\/ul>Details<\/b><p>No details available yet. If you are the spot\/track owner or a local rider who wants to add info of this spot, please contact us.<\/p><p><b id=\"f\">Features<\/b><table><tr><td><img src=\"\/images\/starthill.gif\" alt=\"\" onmouseover=\"f('Starthill with start gate.');\" onmouseout=\"f('Features');\" \/><\/td><\/tr><\/table><\/p><\/div>", 84,"Bicross Club Soumagne","BE"); |
Edit:
Ok i've found it, a bit logic actually.
But I've found a better way, instead of escaping the " double quotes and slashes, you can better escape the ' single quotes.
this is my result:
Code: | var marker = createMarker(point,'Bicross Club Soumagne','<span><img src="/nucleus/plugins/googlemaps/flags/be.gif" alt="" /></span><h2><a href="/item/bicross-club-soumagne">Bicross Club Soumagne</a></h2><b><ul><li><a onclick="zoomMarker(16);" title="Zoom In"><img src="/images/zoom.gif" alt=""></a></li><li><a onclick="zoomMarker(2);" title="Zoom Out"><img src="/images/zoom-out.gif" alt=""></a></li></ul>Details</b><p>No details available yet. If you are the spot/track owner or a local rider who wants to add info of this spot, please contact us.</p><p><b id="f">Features</b><table><tr><td><img src="/images/starthill.gif" alt="" onmouseover="f(\'Starthill with start gate.\');" /></td></tr></table></p>','84','Bicross Club Soumagne','BE'); |
742 characters long instead of 902
I also put the <div class="infowindow"> in the createMarker function itself instead of outputting it for every marker.
160 characters less for every marker isn't bad, if you multiply that with 500 markers
Hope this will help someone with the same problem.
greets _________________ http://www.bmxaction.net |
|
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
|