[OpenLayers-Users] How can I display a map with a position
changing marker.
Kris Geusebroek
kgeusebroek at xebia.com
Tue May 12 05:40:02 EDT 2009
Hi,
Yes that's the whole point.
The lon, lan will be in your db, you configure your datastore and layer
in geoserver
In your openlayers based client you configure your layers as a vector
layer with bbox strategy and wfs protocol
Where the wfs protocol must be configured to connect to the right layer
and geoserver instance.
Something like this:
var wfsLayerOptions = {
url: GEOSERVER_WFS_URL,//something like
http://localhost:8080/geoserver/wfs
geometryName: "GEOMETRY",
featureNS: FEATURENAMESPACE,//something like
http://www.blah.org/topp
version: "1.0.0"
};
var layerOptions = {
filter: filter,
projection: RDPROJECTION
};
wfsLayer = new OpenLayers.Layer.Vector("wfsLayerName",
OpenLayers.Util.extend({
styleMap: styles[0],
strategies: [
new OpenLayers.Strategy.BBOX(),
new OpenLayers.Strategy.Cluster({
threshold: 2,
distance: 30
})
],
protocol: new OpenLayers.Protocol.WFS(
OpenLayers.Util.extend({
featureType:
'LAYER_NAME_IN_GEOSERVER'
}, wfsLayerOptions)
)
}, layerOptions)
);
Cheers Kris
More information about the Users
mailing list