[Chameleon] Highlight search result in map

Federica De Martin federica.demartin at gmail.com
Thu Mar 27 13:13:09 EDT 2008


Hi, always me, Federica. Thank you Julien for the fast answer.
The Highlight works fine for me in the query widget, also between zoom. My
problem is when I make a search with some php code and then I use my
funciton "AddSelection" and try to zoom setting the New Extents with
goCWCJSAPI.oMap.SetExtents(x,y,x2,y2) function. In my opinion the features
don't highlight because the second function is called before the first is
over, but I don't know how to correct it.
Finally I prefer to make something via php like this one
http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.html that
is more sure, but I don't know where to put the php code to make it work. I
also tried to put it in the function ParseUrl (that I have added) in the
Update.widget.php but it doesn't work,
any suggestion?

Thanks.

Federica

2008/3/27, Julien-Samuel Lacroix <jlacroix at mapgears.com>:
>
> Hi,
>
> Do the Chameleon samples work?
> If they work, you can try to go in sample_basic.phtml and
> sample-basic_jsapi.phtml and add the following parameter to the Query
> widget:
> HighlightResults="true"
>
> This should highlight the result of your query and keep it highlighted
> between zoom.
>
> Is that what you were looking for?
>
> Julien
>
> PS: If sample_basic.phtml works and not sample_basic_jsapi.phtml you may
> need to install Chameleon 2.6rc1.
>
>
> Federica De Martin wrote:
> >
> > Hi,
> > I write again and I hope somebody is going to answer me...
> > Now I use this function but it works only with Point layer and if I try
> > to zoom after or before it doesn't work...
> > function addSelection(nX ,nY,nX2 ,nY2){
> >    var queryCoords = nX + "," + nY + "," + nX2 + "," + nY2;
> >    var img = CWCDHTML_GetImage( 'MapLayerDivImg' );
> >    var str_gMap=gMapDHTMLURL .split("&UniqId=");
> >    mg.src = str_gMap[0] + "&run_query=1&gszQueryCoords=" + queryCoords ;
> >    window.status = img.src;
> >    goCWCJSAPI.oMap.Refresh();
> > }
> >
> > I also have tried with this function that create a new layer with a
> > point using the existing jsapi function but it doesen't work for me.
> > function AddSel(nX ,nY,szName){
> >     goCWCJSAPI.oMap.CreateNewLayer("tmp_"+szName, "POINT", 1);
> >     goCWCJSAPI.RefreshMap();
> >     // var layer_orig=goCWCJSAPI.oMap.GetLayerByName(szName);
> >     var layer_sel=goCWCJSAPI.oMap.GetLayerByName('tmp_'+szName);
> >     // layer_sel=layer_orig;
> >     var p=new CWCPoint();
> >     p.x=nX ;
> >     p.y=nY;
> >     p.symbol=0;
> >     p.symbol_size=40;
> >     p.symbol_color="255,0,100";
> >     p.symbol_outlinecolour = "255,255,255";
> >     //layer_sel.SetStatus()="ON";
> >     goCWCJSAPI.oMap.GetLayerByName('tmp_'+szName).SetStatus("ON");
> >     layer_sel.SetProjection="epsg:26591";
> >     layer_sel.Promote();
> >     goCWCJSAPI.oMap.AddPoint("tmp_"+szName, p);
> > }
> >
> > I think that the right way to approch to the problem is this
>
> > <http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.html>
> > <http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.html
> >but
> > I am not able to make it work. I wait for some pieces of advice!
> > Tanks Federica.
> >
> > Hi everybody,
> > I'm working on how to highlight elements in map. I need a function to do
> >
> > this from a popup and from the same form of the map. I find out this
> > http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.htmlbut
> >
> > I'm not able to make it work.
> > I don't know where to put the php code, I also tried to use ajax but I
> get
> > an error in php file on the final istruction:
> >
> > $_SESSION["gszCurrentState"] = $oMapSession->saveState();
> >
> > ... saveState() on a non-object ...
> >
> > maybe because I don't include or call any other chameleon file (but if I
> try
> > I get many errors... maybe I include the wrong files...).
> > Can you help me to make that example work or can you give me an idea on
> how
> >
> > to proceed to solve this problem?
> >
> > Thank you,
> > Federica
> >
> >
>
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Chameleon mailing list
> > Chameleon at lists.maptools.org
> > http://lists.maptools.org/mailman/listinfo/chameleon
>
>
> --
> Julien-Samuel Lacroix
> Mapgears
> http://www.mapgears.com/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20080327/a469e7cf/attachment.html


More information about the Chameleon mailing list