You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Amit Nithian <an...@gmail.com> on 2009/04/14 03:05:04 UTC

Google Maps and Tapestry

How does one go about using Google Maps with Tapestry? I understand how to
use Google Maps JS API but am unclear about how I can integrate that into
Tapestry. I read online that it's been integrated into Tapestry at least
once but am having a tough time finding out documentation/examples about
this.
Thanks
Amit

Re: Google Maps and Tapestry

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 13 Apr 2009 22:05:04 -0300, Amit Nithian <an...@gmail.com>  
escreveu:

> How does one go about using Google Maps with Tapestry? I understand how  
> to use Google Maps JS API but am unclear about how I can integrate that  
> into
> Tapestry. I read online that it's been integrated into Tapestry at least
> once but am having a tough time finding out documentation/examples about
> this.

Unfortunately, I've never used the Google Maps API yet, but I guess  
there's nothing special about integrating it (or any other JS code) with  
Tapestry. All you need to know about using Javascript with Tapestry is  
here: http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained. I'm  
using a jQuery color picker (http://www.eyecon.ro/colorpicker/) and the  
only change needed was adding jQuery.noConflict() after including jQuery  
and replacing all jQuery's $() function calls in ColorPicker to jQuery().  
You should do even less to use Google Maps API with Tapestry.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Google Maps and Tapestry

Posted by "Joost Schouten (mailing lists)" <jo...@jsportal.com>.
have a look at http://www.chenillekit.org/chenillekit-tapestry/ref/org/chenillekit/tapestry/core/components/GPlotter.html

I found this a bit too limited when I looked at it and build one
myself. Check out http://www.carealoud.com/en/caredforby/joostschouten
for a working tapestry example (still in beta ;-).

If you wish to do it yourself, just code your javascript file and add
it through @IncludeJavaScriptLibrary. them add a @BeginRender method
like:

@BeginRender
    void doBeginRender(MarkupWriter writer) {
		clientId = renderSupport.allocateClientId(resources);
        Element root = writer.getDocument().getRootElement();
        if(root.getElementById("gmap") == null) {
	        Element head = root.find("head");
	
	        head.element("script",
	                     "src",
"http://maps.google.com/maps?file=api&v=2&key=yourKey",
	                     "type", "text/javascript",
	                     "id", "gmap");
        }
}

hope it helps,
Joost

On Tue, Apr 14, 2009 at 9:05 AM, Amit Nithian <an...@gmail.com> wrote:
> How does one go about using Google Maps with Tapestry? I understand how to
> use Google Maps JS API but am unclear about how I can integrate that into
> Tapestry. I read online that it's been integrated into Tapestry at least
> once but am having a tough time finding out documentation/examples about
> this.
> Thanks
> Amit
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org