i would add the normal html <script> tag directly in the page...

You might also like to take a look at tacos:Gmap component:
http://opencomponentry.com:8080/tacos/tests/Maps.html

All its code is at
https://svn.sourceforge.net/svnroot/tacos/tacos-4.0/trunk/src/java/net/sf/tacos/components/maps/

It can take the google key as a parameter but it can also look it up at
the tacos.components.MapLicenses
configuration point and choose the most appropriate key... For instance
https://svn.sourceforge.net/svnroot/tacos/tacos-4.0/trunk/demo/docroot/WEB-INF/hivemodule.xml
configures 3 licenses and the correct one will be used.

As is, the component accepts width, height, zoom, type ( street,
satellite, hybrid ), coordX, coordY.

I could really use a bit of help on how to extend its functionality

Bastian Voigt wrote:
> Hi *,
>
> for using Google Maps on my site, I need to load javascript from an
> external asset.
> Depending on the hostname with which my application is accessed, a
> specific Google Maps Key must be used.
> According to the documentation, there is a scriptAsset parameter which
> can be used for that:
> http://tapestry.apache.org/tapestry4/tapestry/ComponentReference/Script.html
>
>
>
> I have tried the following approach. The html template:
>
> <span jwcid="@Script" scriptAsset="ognl:mapsScriptAsset" />
>
>
> And the java code:
>
> public IAsset getMapsScriptAsset()
> {  String url =
> "http://maps.google.com/maps?file=api&v=2&key="+getMapsKey();
>  ExternalAsset ae = new ExternalAsset(url, getLocation());
>  return ae;
> }
>
>
> It gives the following error:
> "Required parameter script of component Googlemaps/$Script is not bound."
>
> When using parameter "script" instead of "scriptAsset":
> <span jwcid="@Script" script="ognl:mapsScriptAsset" />
>
> It gives the following error:
>
> "Unable to parse script
> context:/WEB-INF/ExternalAsset[http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAXvmBBujxIhwL0oqqKXN5RRRHrpkeUMcZ-AhY_tkw0mxFBafLzxTQ1A84GMM1SSRXvtEYxXc6Vws2DA].";
>
>
>
>
> What am I doing wrong here?
> I would appreciate any help :)
>
> Kind regards
> Bastian
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
Andreas Andreou - [EMAIL PROTECTED] - http://andyhot.di.uoa.gr
Tapestry / Tacos developer
Open Source / J2EE Consulting 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to