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 590803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:34:05+00:00 2026-05-13T15:34:05+00:00

I have a set of GPolygon objects which are attached to objects in my

  • 0

I have a set of GPolygon objects which are attached to objects in my domain model and are added to a map on my page. The domain objects are being shown in a list on the same page and when the user clicks on one of them I want to show the associated polygon.

I want the whole polygon to be showing and ideally I want the map to be centred on the polygon centre.

I was hoping that there would be a maps API call along the lines of…

myMap.makeSureYouCanSeeAllThisPolygon(aPolygon);

but I haven’t been able to find one.

If I have to do this manually, then I can obviously figure out the centering easily, but how do I figure out the zoom?

  • 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-13T15:34:05+00:00Added an answer on May 13, 2026 at 3:34 pm

    You can get the centre point of a polygon by using aPolygon.getBounds().getCenter(); and then using the GLatLng returned with the myMap.setCenter() method.

    To get the zoom level, you can use myMap.getBoundsZoomLevel(aPolygon.getBounds()); then use this with myMap.setZoom() method.

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

Sidebar

Related Questions

I have set up a Core Data model where I have two objects, say
I have set up a shopping basket which is a session list is stored
I have set up 2 servers which are linked. From my LOCAL SERVER, I
I have set permission to allow anonymous user to create page. but when the
I have set default property page so in the property url it shows /lima-investments/property-name.
I have set up a macro for Smarty in Komodo Edit which adds a
I have set of Jquery-UI-Tabs which contains a save button for each tab. I
I have set of classes which inherit from a single super class: Super |
I have set up VisualSvn Server, created a repository and added Visual Studio solution
I have set of records which I need to search using criteria. But criteria

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.