need technical help/ guidance on OpenLayers. We're stuck with following
technical issue and seeking technical help/ advice for resolving the same.
* We are using Wms services (layers published via Geoserver), to
display point, line and polygon features onto the map.
We are using the OpenLayers property "new OpenLayers.Layer.WMS()", for
displaying the layers.
* However, the problem that we are facing is in using
OpenLayers.Control.GetFeature control. We have to perform a selection using
BBox(drag box) and have used
the following code:
control_select = new OpenLayers.Control.GetFeature({
protocol: OpenLayers.Protocol.WFS.fromWMSLayer(layerName),
box: true,
hover: true,
multipleKey: "shiftKey",
toggleKey: "ctrlKey"
});
This control is then added to the map.
* The point feature selection works perfectly but when we select just
one line feature, it happens to select many line features (sometimes more than
30 line features!).
Most of the lines are not even close or connected to the selected line feature!
We are using the "featureselected" event to capture the selection made by the
drag box.
Syntax:- "control_select.events.register("featureselected", this, function(e)
{}"
* We tried to debug OpenLayers.js. It has a predefined set of Geometry
types:
var
order=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"]
We have a table (for the line feature), that has a shape field as Multiline,
which is then converted to Oracle Spatial format and then web services are
created.
After the drag box is created, Openlayers identifies the selected feature as
"MultiLineString" and somehow relates many other line features to create a tree
structure.
It forms one parent node and this node has a nextSibling, which is another line
feature. In this way, it creates a hierarchy of "nextSibling" for every
previous Sibling, thus
selecting a huge range of line features!
* There is an array called "features" created by OpenLayers, where it
pushes all the obtained features from the node:- "obj.features.push(feature);"
Depending on the length of the array, "featureselected" event is fired that
many times thus returning all the features instead of only the selected ones.
Regards,
Manish Barapatre
Office: 01473 650516
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users