Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6588239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:01:23+00:00 2026-05-25T17:01:23+00:00

In my Tapestry template, I have an array of RoutePoint objects (which consist of

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T17:01:24+00:00Added an answer on May 25, 2026 at 5:01 pm

    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:

    @BeginRender
    void doBeginRender(MarkupWriter writer) {
    
        String clientId = javaScriptSupport.allocateClientId(componentResources);
        String mapsScripURL = (request.isSecure()) ? SECURE_GOOGLE_MAPS_SCRIPT_URL : GOOGLE_MAPS_SCRIPT_URL;
        javaScriptSupport.importJavaScriptLibrary(mapsScripURL);
    
    
        writer.element("div", "id", clientId, "class", "googleMapCanvas " + clientId);
            writer.end();
    
        JSONObject parameters = new JSONObject();
        parameters.put("mapCanvasId", clientId);
        parameters.put("geoAddress", geoAddress);
        javaScriptSupport.addInitializerCall("GoogleMap", parameters);
    }
    

    Add a javascript file to your page/component using @Import(library = {"GoogleMap.js"}) where the GoogleMap.js looks somewhat like (I use prototype.js):

    Tapestry.Initializer.GoogleMap = function (parameters) {
    new GoogleMap(parameters);
    };
    
    var GoogleMap = { };
    GoogleMap = Class.create({
    initialize:function(parameters) {
        var geocoder = new google.maps.Geocoder();
        geocoder.geocode( { 'address': parameters.geoAddress}, function(results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                var mapOptions = {
                        zoom: 11,
                        center: results[0].geometry.location,
                        mapTypeId: google.maps.MapTypeId.ROADMAP
                };
                var map = new google.maps.Map(document.getElementById(parameters.mapCanvasId), mapOptions);
                var marker = new google.maps.Marker({
                  map: map, 
                  position: results[0].geometry.location
                });
            }
        });
    }
    });
    

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Tapestry-Security which uses Apache Shiro I have a custom realm which handles
I have been looking for a good Java web framework and found Tapestry, which
I'm using Tapestry 5 and I have a page on which I have a
I have a Tapestry application that is serving its page as UTF-8. That is,
I have a Tapestry PropertyModel for gender. Right now the dropdown just shows Male
The login page in my Tapestry application has a property in which the password
I have a tapestry url that looks like http://localhost:8888/forwardtask/88 how do i get the
I am trying to upgrade the tapestry version from 5.1.0.5 to 5.2.6. I have
I am developing a web-application with Tapestry and I have a bunch of images
My Web application is currently using Tapestry 5.2.6. I want to write a new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.