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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T23:32:41+00:00 2026-05-28T23:32:41+00:00

I would like to show multiple Placemarks by parsing a kml file. Please help,

  • 0

I would like to show multiple Placemarks by parsing a kml file. Please help, Im stuck for long days.

As I see google earth desktop client works well for following kml code snippet

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">

<Document>    
  <Placemark>
    <name>Placemark2 from KML file</name>
    <Point>
      <coordinates>-122.448425,36.802907,0</coordinates>
    </Point>
  </Placemark>
  <Placemark>
    <name>Placemark2 from KML file</name>
    <Point>
      <coordinates>-122.448425,37.802907,0</coordinates>
    </Point>
  </Placemark>
</Document> 
</kml>

Based on the above code snippet I tried by following to show multiple placemark at first look. But NO LUCK. I prefer to parse kml string instead of fetching a .kml file, kml file need to be publicly available and reachable by Google. Moreover by parsing kml string we can test it from localhost.

<script src="//www.google.com/jsapi?key=ABQIAAAA5El50zA4PeDTEMlv-sXFfRSsTL4WIgxhMZ0ZK_kHjwHeQuOD4xTdBhxbkZWuzyYTVeclkwYHpb17ZQ"></script>

<script type="text/javascript">
    var ge;
    var placemark;
    var object;

    google.load("earth", "1");

    function init() {
        google.earth.createInstance('map3d', initCB, failureCB);
    }

    function initCB(instance) {
        ge = instance;
        ge.getWindow().setVisibility(true);
        var kmlString = ''
                        + '<?xml version="1.0" encoding="UTF-8"?>'
                        + '<kml xmlns="http://www.opengis.net/kml/2.2">'
                        + '<Document>'                           
                        + '<Placemark>'
                            + '<name>Placemark1</name>'
                            + '<description>Some Descriptive text.</description>'
                            + '<Point>'
                            + '<coordinates>-122.448425,36.802907,0</coordinates>'
                            + '</Point>'
                        + '</Placemark>'
                        + '<Placemark>'
                            + '<name>Placemark2</name>'
                            + '<Point>'
                            + '<coordinates>-122.448425,37.802907,0</coordinates>'
                            + '</Point>'
                        + '</Placemark>'
                        + '</Document>'
                        + '</kml>';

        var kmlObject = ge.parseKml(kmlString);
        ge.getFeatures().appendChild(kmlObject);
        ge.getView().setAbstractView(kmlObject.getAbstractView());
    }

    function failureCB(errorCode) {
    }

    google.setOnLoadCallback(init);
</script>
<div id="map3d" style="border: 1px solid silver; height: 400px; width: 600px;">
</div>

If I add following camera tag in document then one Placemark is shown. All placemark can be shown by zoom out.

+ '<Camera>'
      + '<longitude>-122.448425</longitude>'
      + '<latitude>36.802907</latitude>'
      + '<altitude>100</altitude >'                             
      + '<tilt>10</tilt>'
      + '<heading>2.7</heading>'
  + '</Camera>'

Have any idea, How can I show mulitple placemark at first look?

  • 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-28T23:32:42+00:00Added an answer on May 28, 2026 at 11:32 pm

    To display kml on google earth we have three methods:

    1.From kml networklink
    2.fetching data from url
    3.fetching data from kml string

    By specifying altitude as 100 in your kml,onload google earth display -122.448425,36.802907 placemark with altitude as 100.So,increase your altitude then you can view all your placemarks.I tried in my machine with altitude as 1000000 .Two placemarks are visible onload of google earth.

    NOTE: If you have so many placemarks then increase your altitude or else go for dynamic kml generation using server-side code with high altitude.Hope this helps you 🙂

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

Sidebar

Related Questions

I would like to show an XML file in my .NET 2.0 WinForms app
I would like to show the number of days missing for a specific date.
I would like to present multiple modal views in sequence (e.g. show confirmation page
I would like to know the best way of parsing an input where multiple
I would like to show progress of multiple Jobs running in parallel, but in
For a multiple choice quiz application i would like to show the dummy answers
I would like to show some hidden text in a Flex application and have
I would like to show some links only to authenticated users in an asp.net
I would like to show a set of consecutive numbers in a UIPickerView component
I would like to show a div based on the Onclick event of an

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.