In my Tapestry template, I have an array of RoutePoint objects (which consist of a latitude and a longitude value) and I want to pass them to javascript, so that the line of points can
be displayed on a map. Has anyone an idea how to do it?
In my Tapestry template, I have an array of RoutePoint objects (which consist of
Share
Somewhat like @Pointy noted but Tapestry has a more elegant way of initializing scripts that inlining it into a
<script>tag. Here is my GoogleMap component code showing how I add a map to my Tapestry page printing a pointer on an address. For how to add multiple connecting with a line check out the google maps API.In your Tapestry page:
Add a javascript file to your page/component using
@Import(library = {"GoogleMap.js"})where the GoogleMap.js looks somewhat like (I use prototype.js):Good luck!