[OpenLayers-Users] Customising Toolbar
Cicconetti, Bob
BCicconetti at dnr.state.md.us
Wed Apr 25 12:19:10 EDT 2007
Ah. That looks useful for a general purpose map.
My needs are a trifle more specialized; I have a point shapefile with x,y coords in my current projection; I need to run a query against that, remove invalid points (-1,-1, 0,0, etc), find the min/max x/y, then pan to the center. It looks much easier to do with Mapserver than it was to do in ArcView. The ArcObjects model is a pain.
Looks like I can have a server-side perl mapscript script that will return the coords to my map object.
R C
> -----Original Message-----
> From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org]
> On Behalf Of Benoit PESTY
> Sent: Wednesday, April 25, 2007 11:48 AM
> To: users at openlayers.org
> Subject: Re: [OpenLayers-Users] Customising Toolbar
>
> Excellent, thanks for the response.
>
> For the search function geonames works quite well :
>
> --------------------------------------------------------------------------
> ---
>
> /**
> * Callback called when a result is found
> * Affiche le résultat dans "resultDiv".
> */
> function getLocation(jData) {
> if (jData == null) {
> return;
> }
>
> var html = '';
> var geonames = jData.geonames;
> for (i=0;i< geonames.length;i++) {
> var name = geonames[i];
> html = html + '<a href="javascript:changezoom(' +
> name.lng + ',' +
> name.lat + ',4);">' + name.name + ', '+ name.adminName1 + '</a><br/>';
> }
> document.getElementById('resultDiv').innerHTML = html;
> }
>
> /**
> * Search for a place
> */
> function search() {
> request = 'http://ws.geonames.org/searchJSON?q=' +
> encodeURIComponent(document.getElementById('q').value) +
> '&maxRows=6&country=FR&lang=FR&fclass=A&callback=getLocation';
> aObj = new JSONscriptRequest(request);
> aObj.buildScriptTag();
> aObj.addScriptTag();
> }
>
More information about the Users
mailing list