p.mapper v4 has nearly no global Javascript functions any more. This 
avoids conflicts with a user defined function overwriting existing ones 
when having the same name. All functions are encapsulated in their 
static class and namespace.

 From outside the class you have therefore to call the functions with 
the namespace prefix. In your case this would be

PM.Map.updateMap(mapurl, '');

because the function is declared in the class Map which is a child of 
PM. This is for all calls to existing functions (except the remaining 
very few global ones, like '_p()').

Armin

On 10/07/2009 13:45, Andreas P. wrote:
> Hello Armin and all,
> 
> I would like to call functions showloading() and updateMap(mapurl) from
> map.phtml.
> 
> How I can do so? I would like to call these two functions from map.phtml as
> I have integrated a javascript calendar in div section of Reference Map. I
> have done the same in v.3.2 and I was able to call them as they are
> (showloading() , updateMap(mapurl)).
> 
> Unfortunately, I can't do the same in v.4
> 
> Here is my code in v.3.2 that works fine: 
> 
> <script type="text/javascript">
> 
>   function dateChanged(calendar) {
>       if (calendar.dateClicked) {
>       var y = calendar.date.getFullYear();
>       var m = calendar.date.getMonth();     // integer, 0..11
>       var d = calendar.date.getDate();      // integer, 1..31
>       var l = calendar.date.print("%Y/%m/%d");
>         showloading();
>         // var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID;
>         var mapurl = PM_XAJAX_LOCATION + 'x_load.php?'+SID+'&date='+l +
> '&resultlayer=remove';
>           updateMap(mapurl);
>    }
>   };
> 
>   Calendar.setup(
>     {
>       date         : '<?php echo $_SESSION['date']?>',
>       flat         : "calendar-container",
>       flatCallback : dateChanged
>     }
>   );
> </script>
> 
> Could anyone give me help on how I can integrate the same code in v.4?
> 
> Thank you in advance!
> 
> Regards,
> 
> Andreas


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
pmapper-users mailing list
pmapper-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pmapper-users

Reply via email to