Referring to this question, did you put the correct link to the python directory in proxy.cgi? I've used python download from FWTools in my Windows environment. I've copied proxy.cgi to the apache\cgi-bin directory, and changed the first line from '#!/usr/bin/env python into: '#!C:\Gis\apps\FWTools\python\python.exe -u (without the ' before the # character, but this html can't get this right) I have a different question concerning the searchservice. My proxy.cgi script is working correctly. Using the standard script openls.html zooms in on the right address. When using the code in my own openlayers.html script, zooming-in doesn't function. The returned code is exactly the same response code as the original script in openls.html. The difference is that i'm using a different projection (see part of the code below)
The returned code is not in EPSG:28992, but in EPSG:4326:
I assume that the different projection is the reason that zooming isn't working. How can I get this search-zoom-action working? Thanks in advance for any response. asked 29 Jan '12, 22:12 ar_osmap SimonPoole ♦ |
Did you see this? http://wiki.openstreetmap.org/wiki/OpenLayers_Simple_Example#Use_Proj4js_for_other_transformations answered 31 Jan '12, 11:56 pascal_n Hi Pascal, Thanks for your response. Unfortunately, it hasn't helped me out. I added:
and changed:
With the original code, without the above .transform addition but zoomlevel changed to 6 the page zooms in to the center coordinate of the map when using the search function. With the additions above, te page zooms in to 131500,479800 (EPSG:28992, RD-New), but the coordinates (OpenLayers.Control.MousePosition) are shown in EPSG:4326 I'm new with Openlayers, it would be very nice if I could get this address search function working. Would it be helpful to post (part of) the openlayers.html page?
(31 Jan '12, 20:56)
ar_osmap
1
The Geocoder will always return coordinates in EPSG:4326. So if you need the coordinate in your system ("EPSG:28992"), this should help you: var foundPosition = new OpenLayers.LonLat(geometry.x, geometry.y).transform( new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:28992") ); If you have further issues, maybe it could be useful if you post your complete html-page here.
(31 Jan '12, 23:31)
pascal_n
Hi Pascal, Thanks a lot, address search is almost perfect now. The only thing is that the found location is about 100 m south of the correct location, after changing +lon in EPSG28992.js, found location is perfect. Another thing is that coordinates (OpenLayers.Control.MousePosition) are shown in EPSG:4326-coordinates instead of EPSG:28992. I can live with that. Yet another thing, when I use the right-arrow cursor in the address search field, the map moves in right direction. This doesn't happen in example openls.html. I have a question about tilecache to improve performance, but I'll ask that in another forum. Posting my html-file here doesn't show in the preview, so I forget about that. Thanks again!
(01 Feb '12, 09:35)
ar_osmap
|
"Another thing is that coordinates (OpenLayers.Control.MousePosition) are shown in EPSG:4326-coordinates instead of EPSG:28992" A displayProjection: new OpenLayers.Projection("EPSG:28992") or new OpenLayers.Control.MousePosition({"numDigits": 2, displayProjection: new OpenLayers.Projection("EPSG:28992")}) should solve your problem. "Yet another thing, when I use the right-arrow cursor in the address search field, the map moves in right direction." You should check your OpenLayers.controls which you addd to your map. Did you add new OpenLayers.Control.KeyboardDefaults()? Maybe try to remove this ... answered 03 Feb '12, 08:45 pascal_n Hi Pascal, These two things are resolved to! Thanks alot! Arjen
(03 Feb '12, 10:45)
ar_osmap
|