What is KML, what do you use it to and some great references.
KML is a great way of providing your maps-solution with large amounts of POI’s. KML is based on XML and closely related to GML (Geography Markup Language). A great way of providing the public Google Maps or your own implementation with POIs.
This is the first article in a series of mapping-technology, so why not start out with some facts and clarifications. My first article will be about KML, which might be somewhere in the middle, but why not.
KML is short for Keyhole Markup Language and it is a XML-based language. This language is used for storing and visualizing large amounts of geographic data. KML and other location based markup languages are used to represent for example POI’s (Point of Interest), routes, structures or other type of information that is strengthened by the geographic relation. It is able to store both two-dimensional and three-dimensional data, which makes it a great tool to distribute data both to for example Google Maps and Google Earth. These are types of GIS’s (Geographic Information Systems).
KML has many similarities in its grammar to the standardized Geography Markup Language (GML - Geography Markup Language), connecting them together is the coordinates reference system (CRS). The GML is all though very vast and can probably represent any type of geographic object, but on the off side of being very capable is getting to complex for ordinary things. What KML brings to the table is styling properties and the ability to represent 3D structures, which is very much Google Earth.
References and great places to look for inspiration
Here are some great references for getting started with KML-development.
- KML reference and developer handbook by Google
- A great .NET KML-wrapper framework by Daniel Berg
- Look at the "Related links" box on the right!
Typical problems with getting KML on to your maps-solution
If you have trouble getting KML from your server on to your map there is probably one of these two reasons:
- The server rendering the KML have to be public (as Daniel also posted), at least if you want to use it on a public maps service such as Google Maps. This also means that it is accessible for clients.
- You might have to add .KML as a mime-type on your Web server. This could be done in the MIME-Type section on your IIS.
- Associated Mime-type: application/vnd.google-earth.kml+xml;
This image is an IIS 7.5 installation, will look a little bit different on older web servers.
Prerequisite is that there are no code errors of course ...