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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T04:08:05+00:00 2026-06-17T04:08:05+00:00

I created a KML file that defines several zones using polygons, in Google Earth.

  • 0

I created a KML file that defines several zones using polygons, in Google Earth. My plan was to just use this file on my wordpress site, along with “comprehensive google maps plugin” for wordpress. However, it turns out that while it works, per the developer, I am unable to set a center or zoom. I want to zoom to 10, and center at specific coordinates. I have googled and researched and I keep coming up with a few scripts, but its a bit confusing to me what i would even do with them. This is my first foray into KML. Is there something i can add into the KML file that was generated by google earth, that would allow me to accomplish this? any help would be tremendously appreciated.

  • 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-06-17T04:08:06+00:00Added an answer on June 17, 2026 at 4:08 am

    Try with WP Flexible Map instead. It allows you to specify zoom on a KML map, and also gives you access to the map object so that you can set centre after it loads.

    Example of shortcode to load KML file; NB: per FAQ, I set an id from which a JavaScript global variable name is later derived. [Edit: I’m an idiot, I copypasta’d the wrong example! fixed]

    [flexiblemap id="exmap" zoom="14" width="500" height="400"
        src="http://snippets.webaware.com.au/maps/example-toronto.kml"]
    

    Now, add this code to a plugin (or your theme’s functions.php if you wish):

    add_filter('flexmap_shortcode_html', 'filterFlxmapShortcodeHtml', 10, 2);
    
    /**
    * append our script to the end of the map shortcode's HTML
    * @param string $html
    * @param array $attrs the shortcode's array of attributes/parameters
    * @return string
    */
    function filterFlxmapShortcodeHtml($html, $attrs) {
        $html .= <<<HTML
    <script>
    jQuery(window).load(function() {
        flxmap_exmap.setCenter(new google.maps.LatLng("12.345", "32.109"));
    });
    </script>
    
    HTML;
    
        return $html;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've created a simple KML file that works in the standalone Google Earth client,
How can i create .KMZ (google earth file format) programmatically? .KMZ contains a .KML
I have a VB.NET app that generates KML to show within Google Earth. I
I am using this code to make a KML file: Sub Create_KML() ' Builds
I'm trying to upload a kml file created by gpslogger to google fusion tables,
I am generating a dynamic kml file via php for use with google maps,
is there anyway to compress a KML file? My KML files are created once
I am using the code in this question NSURLConnection download large file (>40MB) to
I'm using Google Maps to create a map that can pull (and toggle) various
I have a rails app that creates a kml file and successfully loads it

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.