views:

200

answers:

2

I would like to display a SVG layer (polygons) over the openlayers tiles in an html page, or alternatively, load my SVG in flash and have the OL tiles rendered into flash as well.

Is any/either of these ideas possible at all?

Thanks in advance

A: 

Do you have special polygons you want to display? OpenLayers has a built in vector layer that you can place geometries on. There is no need to have your own custom layer.

http://openlayers.org/dev/examples/drag-feature.html

Conley Owens
I have 2900+ chinese counties to show on a map. say I have a table with polygon (county) ids, geom and a color code. i can create a svg or kml file from that but it's big: 5mb at least. i am trying svg because it loads gradually while the kml file loads all 5mb before showing anything. Are you suggesting that I should generate the 2900+ polygons dynamically from within the OL framework?
Barnabe
That's what I would do. If these are stored in a geospatial database, it's pretty easy to read in the data with an OL parser <http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Format/WKT-js.html> to get a geometry and then create a vector from that using the vector class constructor <http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Feature/Vector-js.html>. Then you just add it to the vector layer. You will have to use ajax to get the data, since you don't want to embed 5MB in the html or js, but it should load gradually.
Conley Owens
A: 

try to use geoserver or mapserver... and openlayers

Stefan Simon