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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:55:34+00:00 2026-06-01T08:55:34+00:00

I am adding a KMZ file through network link on a ADD KMZ button’s

  • 0

I am adding a KMZ file through network link on a ADD KMZ button’s onclick as follows :-

var nlFile=null;
function addKMZData(){
    nlFile=ge.createNetworkLink('exampleKMLNL1');
    nlFile.setVisibility(true);
    var link = ge.createLink(" exampleLink1 ");
    link.setHref('http://localhost:8080/KMZs/example.kmz');
    nlFile.setLink(link);
    nlFile.setFlyToView(true);
    nlFile.setName('kmz');
    ge.getGlobe().getFeatures().appendChild(nlFile);
}

The ‘example.kmz’ file taken here contains a linestring placemark and the installed plugin version is 6.1.0.5001.

Then, I have a REMOVE button, clicking which removes the above added KMZ ‘s network link from the ge-plugin’s instance. The following is the REMOVE button’s onclick function :

function clearKMZData(){
    ge.getFeatures().removeChild(ge.getElementById('exampleKMLNL1'));
    nlFile=null;
}

These functions work well for the first time. But any attempt to add the same KMZ file using the addKMZData() function after removing the added KMZ network link, gives the error “Error calling method on NPObject!” at line 1 of the add function. Is this way of adding & removing KMZ/KML data through network links correct? Am I missing something in the above 2 JavaScript functions?

Regards,
Shiva

  • 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-01T08:55:35+00:00Added an answer on June 1, 2026 at 8:55 am

    So long as var nlFile is global

    In your first function, change this

          nlFile=ge.createNetworkLink('exampleKMLNL1');
    

    to this

          nlFile=ge.createNetworkLink('');
    

    and change this

          function clearKMZData(){
              ge.getFeatures().removeChild(ge.getElementById('exampleKMLNL1'));
              nlFile=null;
          }
    

    to this

          function clearKMZData(){
              ge.getFeatures().removeChild(nlFile);
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Adding the row one by one in the button click.. (i tried but its
Adding some gui modifications and I want to have a button which is 10pixels
After adding the link options: -lssl and -lcrypto, my program was correctly compiled. However,
Adding file information to a program. /** * @Author: Kyle * @Date: 9-29-2010 *
Adding methods to native JavaScript objects like Object, Function, Array, String, etc considered as
Adding player name into list: chatList0.Add(s); Adding player msg into list: chatList.Add(s); Printing the
Adding log4j [1] in tomcat 6.0.x forces tomcat to produce logs in catalina file.
Adding an element to the head of an alist (Associative list) is simple enough:
Adding source files more than one directory away (e.g. ../../source.cpp or ../../../somewhere_else/source.cpp, vs. just
Adding more than one child to a WPF StatusBar results in poor layout 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.