<div><br>Hi, <br>I write again and I hope somebody is going to answer me...<br>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...<br><span style="font-style: italic;">function addSelection(nX ,nY,nX2 ,nY2){</span><br style="font-style: italic;">
<span style="font-style: italic;"> var queryCoords = nX + "," + nY + "," + nX2 + "," + nY2;</span><br style="font-style: italic;"><span style="font-style: italic;"> var img = CWCDHTML_GetImage( 'MapLayerDivImg' );</span><br style="font-style: italic;">
<span style="font-style: italic;"> var str_gMap=gMapDHTMLURL .split("&UniqId=");</span><br style="font-style: italic;"><span style="font-style: italic;"> mg.src = str_gMap[0] + "&run_query=1&gszQueryCoords=" + queryCoords ;</span><br style="font-style: italic;">
<span style="font-style: italic;"> window.status = img.src;</span><br style="font-style: italic;"><span style="font-style: italic;"> goCWCJSAPI.oMap.Refresh();</span><br style="font-style: italic;"><span style="font-style: italic;">}</span><br>
</div><br>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.<br><font size="2"><span style="font-style: italic;">function AddSel(nX ,nY,szName){</span><br style="font-style: italic;">
<span style="font-style: italic;"> goCWCJSAPI.oMap.CreateNewLayer("tmp_"+szName, "POINT", 1);</span><br style="font-style: italic;">
<span style="font-style: italic;"> goCWCJSAPI.RefreshMap();</span><br style="font-style: italic;">
<span style="font-style: italic;"> // var layer_orig=goCWCJSAPI.oMap.GetLayerByName(szName); </span><br style="font-style: italic;">
<span style="font-style: italic;"> var layer_sel=goCWCJSAPI.oMap.GetLayerByName('tmp_'+szName); </span><br style="font-style: italic;">
<span style="font-style: italic;"> // layer_sel=layer_orig;</span><br style="font-style: italic;">
<span style="font-style: italic;"> var p=new CWCPoint();</span><br style="font-style: italic;">
<span style="font-style: italic;"> p.x=nX ;</span><br style="font-style: italic;">
<span style="font-style: italic;"> p.y=nY;</span><br style="font-style: italic;">
<span style="font-style: italic;"> p.symbol=0;</span><br style="font-style: italic;">
<span style="font-style: italic;"> p.symbol_size=40;</span><br style="font-style: italic;">
<span style="font-style: italic;"> p.symbol_color="255,0,100";</span><br style="font-style: italic;">
<span style="font-style: italic;"> p.symbol_outlinecolour = "255,255,255"; </span><br style="font-style: italic;">
<span style="font-style: italic;"> //layer_sel.SetStatus()="ON";</span><br style="font-style: italic;">
<span style="font-style: italic;"> goCWCJSAPI.oMap.GetLayerByName('tmp_'+szName).SetStatus("ON");</span><br style="font-style: italic;">
<span style="font-style: italic;"> layer_sel.SetProjection="epsg:26591";</span><br style="font-style: italic;">
<span style="font-style: italic;"> layer_sel.Promote();</span><span style="font-style: italic;"></span><br style="font-style: italic;">
<span style="font-style: italic;"> goCWCJSAPI.oMap.AddPoint("tmp_"+szName, p);</span><br style="font-style: italic;">
<span style="font-style: italic;">}</span></font><br><br><font size="2"><span style="font-style: italic;"></span><span style="font-style: italic;"></span></font>I think that the right way to approch to the problem is <a href="http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.html">this</a> <a href="http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.html"></a>but I am not able to make it work. I wait for some pieces of advice!<br>
Tanks Federica.<br>
<br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><pre>Hi everybody,<br>I'm working on how to highlight elements in map. I need a function to do<br>
this from a popup and from the same form of the map. I find out this<br><a href="http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.html">http://lists.maptools.org/pipermail/chameleon-dev/2005-May/003973.html</a> but<br>
I'm not able to make it work.<br>I don't know where to put the php code, I also tried to use ajax but I get<br>an error in php file on the final istruction:<br><br>$_SESSION["gszCurrentState"] = $oMapSession->saveState();<br>
... saveState() on a non-object ...<br><br>maybe because I don't include or call any other chameleon file (but if I try<br>I get many errors... maybe I include the wrong files...).<br>Can you help me to make that example work or can you give me an idea on how<br>
to proceed to solve this problem?<br><br>Thank you,<br>Federica</pre></blockquote>