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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T20:39:02+00:00 2026-05-15T20:39:02+00:00

I got a Windows Forms app making use of Google Earth where users can

  • 0

I got a Windows Forms app making use of Google Earth where users can draw a polygon on the map which is used as a geofence.

What I’d like to do is to be able to zoom to the polygon so that it fits nicely on screen with a click of a button. A sort of zoom to fit function.

Finding the centre of the polygon and setting the Google Earth camera to that lat/long is easy.

What I need is an algorithm that takes a bounding box of lats \ longs, screen height \ width and then determines the altitude to set the camera.

Does anyone have this algorithm or know where one can be found?

Thanks!!

  • 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-15T20:39:03+00:00Added an answer on May 15, 2026 at 8:39 pm

    To “zoom to the polygon” or any other KmlObject it is probably easiest to use the earth-api-utility-library.

    See the methods createBoundsView, setToBoundsView and especially flyToObject

    For example, where ge is the GEPlugin object and polygon is a KmlPolygon.

    var gex = new GEarthExtensions(ge);
    gex.util.flyToObject(polygon, { boundsFallback: true, aspectRatio: 1 } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a simple app I'm working on, I've got three related assemblies: MyCompany.Geography.Windows.Forms which
While trying to use LINQ in a .NET 2.0 Windows Forms project I got:
I've got some RDL using it in a (windows forms) .net 2.0 app. When
I got a ASP.Net webforms app which is using Forms authentication. It needs to
I've got a very simple Windows Form app that hits an IIS 7 site
vb.net windows forms question. I've got 3 forms that have exactly the same functions,
We have got a web application and a windows forms application. The web application
I've got an ASP.NET (.NET 4.0) application that uses Windows Forms Authentication. This authenticates
We've got a (Windows) application, with which we distribute an entire Python installation (including
I've got yet another deployment problem. What I have: little Windows Forms application that

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.