| Programming with JViews Maps > Introducing the Main Classes > Readers and Writers > The KML Reader and Writer |
The KML Reader and Writer |
INDEX
PREVIOUS
NEXT
|
There are two ways of reading KML or KMZ files:
IlvKMLReader instance directly. In this case, you must write all the code required to render the KML features into graphic objects, and then add them to the manager.
IlvKMLDataSource. This is a convenient way of performing all the above operations at once and is more integrated with the data model of the map.
This section contains the following topics:
The source code for the Map Builder demonstration, which contains all the code described in this section, can be found at <installdir>/jviews-maps81/samples/mapbuilder/index.html.
This class reads KML features from a specified KML file or catalog. It implements the IlvMapFeatureIterator interface to iterate over the read features.
To read KML features using the IlvKMLReader object:
IlvFeatureRenderer, and assign them to a manager:
The IlvKMLDataSource class provides a convenient way of creating a set of layers containing KML data in a manager.
To read KML features using the IlvKMLDataSource:
You can export part of a map to a KML (or KMZ) file using the Map Export API (see Map Export API). To do so, set an IlvKMLExporter as the vectorial exporter on the IlvMapExportManager. You can also use the raster exporter, if you want to export an overlaid image.
.kmz, all the files are zipped into a single kmz file:
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |