[OpenLayers-Users] Customising Toolbar

Benoit PESTY tchule at hotmail.com
Wed Apr 25 12:29:38 EDT 2007


Cannot help on this one, don't know ArcView ^^

Another question about the toolbar :

I've managed to add the Delete and Select tools on the vector layer.

I have a function that give me info on a base layer (similar to the CIA 
Factbook example) that is activated with the following line :

map.events.register('click', map, feature_info);

But this activation is permanent , what i'd like to do is to link this 
function to my toolbar. Should I create a new Control object or is there a 
way to bind my function to an existing Control (Navigation, MouseDefaults, 
...) ?

Thanks a lot,

Tchule.





>From: "Cicconetti, Bob" <BCicconetti at dnr.state.md.us>
>To: "Benoit PESTY" <tchule at hotmail.com>,<users at openlayers.org>
>Subject: RE: [OpenLayers-Users] Customising Toolbar
>Date: Wed, 25 Apr 2007 12:19:10 -0400
>
>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();
> > 	}
> >

_________________________________________________________________
Interest Rates NEAR 39yr LOWS!  $430,000 Mortgage for $1,299/mo - Calculate 
new payment 
http://www.lowermybills.com/lre/index.jsp?sourceid=lmb-9632-19132&moid=14888




More information about the Users mailing list