|
From: www.gwtorm.com <jim...@gm...> - 2009-08-31 12:29:18
|
I have data stored in POSTGIS. I can access them through GWT-RPC. What is
best way to retrieve them from POSTGIS and display them on a map in
performance.
1. as double[][]
2. KML
3. GML
4. GeoJSON.
...
I tested KML as in the following code. It doesn't display anything on a map.
KML kml = new KML();
VectorFeature[] features = kml.read(json);
System.out.println(features.length);
// VectorFeature vectorFeature = new VectorFeature();
//
VectorOptions vectorOptions = new VectorOptions();
vectorOptions.setVisibility(true);
vector = new Vector("GeoJSON", vectorOptions);
vector.addFeatures(features);
map.addLayer(vector);
json is a KML string returned from GWT-RPC. I tested the same KML on
http://kml-samples.googlecode.com/svn/trunk/interactive/index.html#./Multi-Geometries/Multi-Geometries.Simple.kml.
It works perfectly.
Thanks,
Jim
|