approach question...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

approach question...

John Cole X

I really like the changes made in 2.5, and I’m trying to modify some of my objects to follow the styles and practices in 2.5, but the examples haven’t quite caught up to the edge J

 

What I’m trying to do is create a control that can be added to a panel (acting as a toolbar) that allows me to set a callback function that will return the map coordinates off of a click on the map.

 

I’ve gathered that I need a control that needs to consume a handler that handles the click event, but I can’t find any examples of just returning the mouse click in map coordinates.  Lots of partial examples (get-feature-info is how we are doing it, but I want to do it in a control), The drawing controls are close, but they seem to magically handle all of their stuff, again leaving no example.

 

Could one of the handler guru’s write up or point me to a generic call back control howto or example?

 

Many thanks,

 

John


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.503 / Virus Database: 269.15.31/1130 - Release Date: 11/14/2007 9:27 AM

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: approach question...

Bart van den Eijnden (OSGIS)-2
John,

you can just use a Control and then on activate register for the click
event:

OpenLayers.Control.FeatureInfo = OpenLayers.Class(OpenLayers.Control, {

activate: function() {
  this.map.events.register("click", this, this.click);
  return OpenLayers.Control.prototype.activate.apply(this,arguments);
    },

    click: function (evt) {
      // do your stuff here
},
CLASS_NAME: "OpenLayers.Control.FeatureInfo"
}

Best regards,
Bart

--
Bart van den Eijnden
OSGIS, Open Source GIS
http://www.osgis.nl


--------- Oorspronkelijk bericht --------
Van: John Cole <[hidden email]>
Naar: [hidden email] <[hidden email]>
Onderwerp: [OpenLayers-Dev] approach question...
Datum: 14/11/07 13:10

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I really like the changes made in 2.5, and I’m trying
> to modify some of my objects to follow the styles and practices in 2.5,
but the

> examples haven’t quite caught up to the edge J
>
> &nbsp;
>
> What I’m trying to do is create a control that can be
> added to a panel (acting as a toolbar) that allows me to set a callback
> function that will return the map coordinates off of a click on the map.
>
> &nbsp;
>
> I’ve gathered that I need a control that needs to
> consume a handler that handles the click event, but I can’t find any
> examples of just returning the mouse click in map coordinates.  Lots of
partial
> examples (get-feature-info is how we are doing it, but I want to do it in
a
> control), The drawing controls are close, but they seem to magically
handle all

> of their stuff, again leaving no example.
>
> &nbsp;
>
> Could one of the handler guru’s write up or point me
> to a generic call back control howto or example?
>
> &nbsp;
>
> Many thanks,
>
> &nbsp;
>
> John
>
>
>
>
>
>
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.15.31/1130 - Release Date:
11/14/2007 9:27 AM
>  This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error please notify the
sender. This message contains confidential information and is intended only
for the individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.
>
>
>
>
> _______________________________________________
> Dev mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/dev
>



_______________________________________________
Dev mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/dev