[OpenLayers-Dev] Testing
Andreas Hocevar
ahocevar at opengeo.org
Wed May 22 19:02:34 PDT 2013
Hey Michael,
you should find all information on how to submit code here:
http://trac.osgeo.org/openlayers/wiki/HowToContribute. You will want to
create a pull request, as explained here:
http://trac.osgeo.org/openlayers/wiki/CreatingPatches.
I hope this helps.
Andreas.
On Wed, May 22, 2013 at 9:34 AM, Michael Ryan <mr at mry4n.net> wrote:
> Thank you Andreas for clearing up that I should assign events like so:
>
> events = map.events
>
> The other part of this is that you have specify that the event you are
> triggering is a left-click.
>
> By tracing the code you see that you need to set the "which" attribute to
> 1 in the object passed to triggerEvent(), otherwise onClick in
> featureclick.js ignores the event.
>
> So, this is what my code should have looked like:
>
> events = map.events;
> events.triggerEvent( 'mousedown', {xy: new OpenLayers.Pixel(0,0), which:
> 1}, map);
> events.triggerEvent('mouseup', {xy: new OpenLayers.Pixel(0,0), which: 1},
> map);
>
> I'm assuming I can get tests written today. Although, I'm not exactly
> clear how to submit them. If anyone wants to clue me in to that procedure
> I'd appreciate it.
>
> -Mike
>
> On May 21, 2013, at 5:21 PM, Michael Ryan <mr at mry4n.net> wrote:
>
> While I've understood I need to use trigger() somehow, I have been
> unsuccessful in implementing it.
>
> I was using test for buttonclick as a reference:
> https://github.com/openlayers/openlayers/blob/master/tests/Events/buttonclick.html
>
> I would have assumed that within the context of the featurclick example
> https://github.com/openlayers/openlayers/pull/174/files
>
> I could have used something like
>
> events = OpenLayers.Events(map, document.getElementById("map"));
> events.triggerEvent({type: 'mousedown', xy: new OpenLayers.Pixel(0,0)},
> map); events.triggerEvent({type: 'mouseup', xy: new OpenLayers.Pixel(0,0)},
> map);
>
> But, apparently, that's wrong.
>
> Am I trying to do something that isn't possible? I'm assuming I'm just
> implementing it wrong. Any thoughts?
>
> -Mike
>
> On May 20, 2013, at 5:04 PM, Michael Ryan <mr at mry4n.net> wrote:
>
> I'll answer my question about triggering a buttonclick by saying, it looks
> like you use trigger() which takes coordinates as an argument as in this
> test:
> https://github.com/drewwells/openlayers/blob/master/tests/Control/Measure.html
>
>
>
>
> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20130522/528cf184/attachment.html>
More information about the Dev
mailing list