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

  • Home
  • SEARCH
  • 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 6347675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:15:53+00:00 2026-05-24T21:15:53+00:00

I want to create a google maps app with kml, and i want to

  • 0

I want to create a google maps app with kml, and i want to create the kml file dynamically depending on the zoom of the user.

Something like google earth but in google maps (the zooming part)

I tried to use the markermanager and clusterer but i have too many markers and performance on mobile devices is very bad but with kml that is not an issue but i have all marker displayed at once.

I tried to use NetworkLink in the kml file but i dont get any parameters like zoom or bounds (i am using php)

I know it could be done with JavaScript

new google.maps.KmlLayer('mykmlgenerator.php?zoom='+zoom);

but i would like to avoid that is there any way?

thank you

  • 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-24T21:15:54+00:00Added an answer on May 24, 2026 at 9:15 pm

    Firstly, let me be clear that OpenLayers are better than Google Maps if you want to use dynamic KML. Next, I want to give some simple JavaScript that we will use in OpenLayers. You should try them since it also using JavaScript library.

    Here I briefly show you how the codes are written.

    <html>
    <head>
    <title>Google Layer with KML file</title>
    <link rel="stylesheet" href="http://openlayers.org/api/theme/default/style.css" type="text/css" />
    <link rel="stylesheet" href="http://openlayers.org/dev/examples/style.css" type="text/css" />
    <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAl9RMqSzhPUXAfeBCXOussRTQDbvAygy0cfGJr8dEMAYKf3RWNBQqP9mjKIsqTfmAlz5LOJ3Xpy5s4w'></script>
    <script src="http://openlayers.org/api/OpenLayers.js"></script>
    <script type="text/javascript">
    
    var map;
    
    function init() {
        // Create the map object
        map = new OpenLayers.Map('map');
        // Create a Google layer
        var gmap = new OpenLayers.Layer.Google(
            "Google Streets", // the default
            {numZoomLevels: 20}
        );
        // Add layer to map
        map.addLayer(gmap);
    
        //Adding KML file to map
        map.addLayer(new OpenLayers.Layer.GML("KML", "yourkml.kml", 
               {
                format: OpenLayers.Format.KML, 
                formatOptions: {
                  extractStyles: true, 
                  extractAttributes: true,
                  maxDepth: 2
                }
               }));
        // Zoom to Kuala Lumpur, Malaysia
        map.setCenter(new OpenLayers.LonLat(101.686855,3.139003), 13);         
    }
    </script>
    </head>
    <body onload="init()">
    <h1 id="title">Google Layer with KML file</h1>
    <div id="map" style='width: 700px; height: 700px'></div>
    </body>
    </html>
    

    As you can see, there is a small orange dot on the map. That is the KML file loaded on Google Maps. And If you want to refresh them, check this link

    Last but not least, I hope my answer isn’t too late for you.

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

Sidebar

Related Questions

Hi I want to create a google maps like interface from very high resolution
I want to create a functionality like Google Maps. I want to update my
I want to create an overlay on top of Google Maps that displays different
I am using Google Maps for my website and I want to create boundaries
i'm using google maps v3 and i want create a new map associate to
Good morning, I want to create a Google Maps overlay from GeoTiff data I
I want to use google maps in JSP page, I tried to create it,
I want to know if i can create a custom google maps application,on which
I want to create a store locator with Google Maps. I have a database
I'm using google maps javascript API, I want to create a small InfoWindow with

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.