[OpenLayers-Users] Best option for visualizing JSON

Christopher Schmidt crschmidt at metacarta.com
Wed Jan 7 16:51:34 EST 2009


On Wed, Jan 07, 2009 at 11:28:37PM +0200, Lehtonen, Mika wrote:
> Hi,
> I have some JSON data produced from an "ordinary" database. Basically 
> it's an array having objects that include x-, y- and some attribute values.
> 
> What would be the best way to render these x-, y-values as points or 
> markers in Openlayers. Should I use Marker or Vector or what layer? Any 
> Examples?

I'd recommend turning the data into GeoJSON on the server, then using a
Vector Layer with the HTTP Protocol and the GeoJSON format
(alternatively, a GML Layer with a GeoJSON format). If you really can't
do that, then you could write a custom subclass o the JSON format,
basing it of something like the GeoJSON format, and follow either of the
above options with your custom format.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list