KML Landmark plugin for web and Google Earth based on Google Map API

Source: Internet
Author: User

KML file is good to do, in your Google Earth (hereinafter referred to as GE) Select your own or someone else's marker or layer, can be saved as a static landmark or layer information (KMZ or KML format), sent to your friends, Use his GE to open your file to see the marker information you have labeled.

These related articles have lost me for quite some time, but I want a dynamic landmark, a GE plug-in like Eemap. Below I will describe how it works and how it is made.

First, a few concepts, the Google Map API is based on Javascript+xml technology, and another product Google Earth API is based on an ActiveX plug-in to achieve the desktop version of the Google Earth Similar effect (perspective, Street View, etc., due to the need to install browser plug-ins and other factors, not widely used, the technology involved in this article is the Google Map API. About Google Map API Key description: In order to prevent this interface from being abused, your site must apply for a key to use the Google Map API, this key is only a corresponding value of your domain, according to the official say, over time to use the same domain name application, Also will get the same key, the same application after idle will not have any effect. Google's development team only asks you to "contact" them when the API traffic is too large for your site to use. When debugging locally (http://localhost:8080/demo.aspx) is not affected by the key can be used normally.

Outline (figures in the corresponding figure):

1, how to achieve such a function (KML)

2, how to write the call file (ASPX)

3, the data file (XML) that should be returned

4, how to Invoke (HTML) on the web

5, the effect used in GE

1, how to achieve such a function (KML)

The above diagram clearly shows its workflow, where the KML file is not in the broadest sense of coordinate data, but an intermediate file that can be invoked by the Google Map API or directly by GE, and its contents are roughly as follows:

<?xml version="1.0" encoding="UTF-8"?>
 <kml xmlns="http://earth.google.com/kml/2.0">
 <NetworkLink>
 <name>OMGSOFT</name>
 <open>1</open>
 <description>火车运行图 - 鸥盟软件 - www.omgsoft.com.cn</description>
 <Url>
   <viewRefreshMode>onStop</viewRefreshMode>
 <viewRefreshTime>2</viewRefreshTime>
 </Url>
 </NetworkLink>
 </kml>

What needs to be explained is the

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.