yahayadeveloper / php-google-map-api

Automatically exported from code.google.com/p/php-google-map-api
0 stars 0 forks source link

add javascript #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
How about the facility to add users own javascript to the onload function 
thereby allowing the user to call there own functions onload in addtion to your 
excellent software

Original issue reported on code.google.com by daiv...@gmail.com on 9 Jul 2011 at 7:17

GoogleCodeExporter commented 8 years ago
This is already in place - check out the source for this demo to see how it's 
possible to call your own custom "onload" code along with the map load 
functions - 
http://www.bradwedell.com/phpgooglemapapi/demos/advanced_multiple_maps.php

ex:
<body onLoad="onload();">
<script type="text/javascript">
function onload(){
    <?=$MAP_OBJECT->printOnLoadFunction();?>();
    //your code here
}
</script>

or if you prefer jquery:
<script type="text/javascript">
$(function(){
    <?=$MAP_OBJECT->printOnLoadFunction();?>();
    //your code here
});
</script>

Original comment by b...@mycnl.com on 18 Sep 2011 at 4:40