[OpenLayers-Dev] Map event confusion
woodbri at swoodbridge.com
Thu Mar 25 22:31:21 EDT 2010
Christopher Schmidt wrote:
> On Thu, Mar 25, 2010 at 03:32:36PM -0600, Tim Schaub wrote:
>> Marc Jansen wrote:
>>> Hi devs,
>>> I am rather confused about the documentation about map-events. Is it
>>> right that
>>> * addmarker,
>>> * removemarker,
>>> * clearmarkers,
>>> * dragstart,
>>> * dragend,
>>> * drag
>>> are defined but never get triggered?
>>> If so, they should IMHO be removed from the EVENT_TYPES-array and the
>>> documentation for that.
>> The problem with removing things from the EVENT_TYPES array is that
>> there could be applications that have subscribers for them and use
>> map.events to publish.
>> If we remove those entries, those applications break.
>> I know this is silly. You are right to point out that there is little
>> sense and lots of confusion in having them.
>> Our safest bet is to mark them as unused and remove them in 3.0. If
>> others think the caution is not needed, I wouldn't be opposed to
>> removing them.
> In general, I'm supportive of any changes that make things simpler which
> means that applications that did not throw errorrs in earlier releases will
> continue to not throw errors in future releases.
> In this particular case, it's hard to imagine that someone has written
> code that specifically registers for an event that doesn't do anything.
> With sufficient documentation, I'd be willing to change the code to not
> have those events. However, since events (unlike methods) are not actually
> in existence in the Natural Docs except if they're documented, I think
> it would be equally successful -- for anyone who isn't actually digging
> into the code itself, a fact that describes more and more of our users --
> to just not document those events. At that point, the events simply
> 'disappear' from the docs completely without any other work on our
> -- Chris
Chris, et al,
I can appreciate this sentiment, I think there are a lot of "casual"
users that will not dig into the code and in those cases, if it is not
in the docs then the problem does indeed go away. But there are a small
but healthy number of "coders" who are trying to do more with OpenLayers
like Marc, myself and others I'm sure that do dig into the code and
spend a lot of time chasing our tails, aka: learning? :) because we try
something like an event that never gets triggered and then scratch our
heads for a while trying to figure out why. We eventually do figure it
out or ask and get help. I would like to see doc that better explains
what events exist and what gets passed to them. I have also noticed that
there is a trend to move away from callbacks, which were somewhat better
documented, in favor of using events (or maybe I'm mistaken) and some
objects say register for such and such event to get notified when
something happens, but there is no additional information as to what is
passed to the event, etc.
Regardless, I'm loving OL and continued to be impressed by how much is
built into OL and how easy OL is to extend once I can get my head to
think about the problem in in the right way.
Thanks all and best regards,
>>> Please ignore the mail if I missed something fundamental (but please
>>> enlighten me where these events are triggered)
>>> Dev mailing list
>>> Dev at openlayers.org
>> Tim Schaub
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>> Dev mailing list
>> Dev at openlayers.org
More information about the Dev