[MapQuery] Better event handling and features support

Volker Mische volker.mische at gmail.com
Sun Apr 22 12:51:10 EDT 2012


Hi devs,

I'm proud to say, that I finally managed to finish my huge effort on
adding better event handling and features support. I've created a pull
request [1].

What does this change mean for you. You get better events, the weird
mixture of OpenLayers and "mq"-prefixed events is gone. There is only
the MapQuery events left, that also get rid of the "mq"-prefix. It will
probably break your code, but I think it's a huge step forward. If you
want to know more, have a look at the comments in the source, but also
the tests.

Feature support means, that you can now get all features of a layer, or
add new ones, just as you are used to do it for layers. It's a simple,
layer.features() to get them, and layer.features({}) to add a new one.

At the moment you can only add GeoJSON features. In the future I'd like
to make it possible to also add features KML or WKT. I propose that we
use OpenLayers' format transformation capabilities. The user would need
to transform his features with it, before he passes it into .features().
This makes the API easier and not bloated.

Of course feedback is welcome for this pull request. I'm sorry that the
last commit of it got so big, but it would've been hard (and time
consuming) to split it up into smaller ones. I'll try to do a better job
next time :)

I'd like to merge it as soon as possible, so any +1 is welcome, even if
you haven't spend hours for a detailed review, but just think it's the
way to go.

[1] https://github.com/mapquery/mapquery/pull/16

Cheers,
  Volker


More information about the MapQuery mailing list