Draw multiline features on map

1 message Options
Embed this post
Permalink
Patrick O'Brian

Draw multiline features on map

Reply Threaded More More options
Print post
Permalink
Hi all,

First of all, we are using Mapbuilder V1.0.1 and it's not possible to upgrade to MB1.5rc2. :(

We are developing a web application where we have to make complex searches through a java interface.
As a result we obtain a list of coordinates defining the features which match the search criteria.
We are able to center the map view calling a jsp which calls a widget with the coordinates to center on, but we also want to draw the found features (multilines) on the map in a different colour.

We have tried to draw it inspired in the measurement widget, like this:

this.doAction = function(objRef,targetNode) {
if (objRef.enabled) {
if(objRef.restart) {
objRef.model.setParam("clearResaltarLine");
objRef.restart= false;
}
var point=objRef.mouseHandler.model.extent.getXY(targetNode.evpl);
var old=objRef.targetModel.getXpathValue(objRef.targetModel,objRef.featureXpath);
if(!old) old="";
var aux = "";
numlines=obtainNumLines();
for(i=0; i< numlines;i++){
    var coord = obtainPoints.(i);
    var x = parseFloat(coord[0]);
    var y = parseFloat(coord[1]);
    aux = aux + " " + x + "," + y;
}
sucess=objRef.targetModel.setXpathValue(objRef.targetModel,objRef.featureXpath,aux);


And it works fine, it paints a line. The problem is when I want to draw a multiline feature, MB draws it as it was one single line, joining the different lines of the multiline.

How could I draw a multiline??

Thank you in advance.

Regards.

Paddy



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
mapbuilder-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel