Create a basic KML document

You can create a KML document in any text editor. The XML header and the KML namespace declaration are required and they must appear at the beginning of the document. You can mark a position on a map in BlackBerry® Maps by using the <Placemark> element. The <Point> element specifies the longitude, latitude, and altitude of the location. Longitude ranges from -180 to +180, latitude ranges from -90 to +90. The altitude is optional and can be passed as 0. If you provide an altitude, the value must represent the altitude above sea level in meters.

Code sample: Creating a basic KML document

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
   <Placemark>
      <name>Ottawa</name>
      <description>Ottawa office</description>
      <Point>
         <coordinates>-90.86948943473118,48.25450093195546,0</coordinates>
      </Point>
   </Placemark>
</kml>

Was this information helpful? Send us your comments.