HERE Maps API - Converting any data file to KML
(Jasfox - Add Stub) |
m (Jasfox - Added intro) |
||
| Line 1: | Line 1: | ||
[[Category:Draft]] | [[Category:Draft]] | ||
{{UnderConstruction|timestamp=20120118141431 }} | {{UnderConstruction|timestamp=20120118141431 }} | ||
| − | {{Abstract|This article explains how to read address data from an | + | {{Abstract|This article explains how to read address data from an arbitrary file format, and create a KML file for display on a map.}} |
{{SeeAlso|[[Nokia Maps API - How to create a KML data file]]<br /> | {{SeeAlso|[[Nokia Maps API - How to create a KML data file]]<br /> | ||
[[Nokia Maps API - How to display KML file data on the map]] | [[Nokia Maps API - How to display KML file data on the map]] | ||
| + | }} | ||
| + | {{Note| in order to load a KML file successfully, the generated KML file should be hosted on the same domain as the JavaScript or the results may be unpredictable. Some browsers will automatically prohibit cross-domain access. | ||
| + | For example, if you are hosting at ''example.com'', the final line of the JavaScript to load the KML will need to be: | ||
| + | <code javascript> | ||
| + | kml.parseKML("http://example.com/" + "generated_kml_data_file.kml") | ||
| + | </code> | ||
| + | and both the KML loading HTML and the generated_kml_data_file.kml should be placed on ''http://example.com/'' | ||
}} | }} | ||
{{ArticleMetaData | {{ArticleMetaData | ||
| Line 32: | Line 39: | ||
== Introduction == | == Introduction == | ||
| + | Keyhole Markup Language (KML) is an XML notation for geographic applications. The advantages of using KML are numerous, and have been listed in a [[Nokia_Maps_:_Converting_from_JavaScript_to_KML| previous article]]. A typical enterprise may wish to add some markers representing addresses onto a map for their website, but without necessarily learning too much about geocoding or KML. It is likely that the address data they have is already held in a file or spreadsheet somewhere. | ||
| + | This example aims to take the pain out of creating a KML dataset. It aims to take any data format and attempt to the locate addresses given by specified fields from the file. The addresses are then transformed into KML <Placemarks> with associated <name> and <description> elements taken from other fields from the same record. The generated KML data can be inspected and edited using the editor example given [[Nokia Maps API - How to create a KML data file|here]] and then displayed using the code from the [[Nokia Maps API - How to display KML file data on the map|How to display KML data]] example. In summary, this article demonstrates a real world use of the geocoding service and is an example of making sequential asynchronous JavaScript calls to obtain longitude and latitude. | ||
== Summary == | == Summary == | ||
Revision as of 18:56, 18 January 2012
This article explains how to read address data from an arbitrary file format, and create a KML file for display on a map.
For example, if you are hosting at example.com, the final line of the JavaScript to load the KML will need to be:
kml.parseKML("http://example.com/" + "generated_kml_data_file.kml")
Article Metadata
Code Example
Tested with
Compatibility
Article
Introduction
Keyhole Markup Language (KML) is an XML notation for geographic applications. The advantages of using KML are numerous, and have been listed in a previous article. A typical enterprise may wish to add some markers representing addresses onto a map for their website, but without necessarily learning too much about geocoding or KML. It is likely that the address data they have is already held in a file or spreadsheet somewhere.
This example aims to take the pain out of creating a KML dataset. It aims to take any data format and attempt to the locate addresses given by specified fields from the file. The addresses are then transformed into KML <Placemarks> with associated <name> and <description> elements taken from other fields from the same record. The generated KML data can be inspected and edited using the editor example given here and then displayed using the code from the How to display KML data example. In summary, this article demonstrates a real world use of the geocoding service and is an example of making sequential asynchronous JavaScript calls to obtain longitude and latitude.
Summary
Add categories below. Remove Category:Draft when the page is complete or near complete

