Zn2O / gwt-google-apis

Automatically exported from code.google.com/p/gwt-google-apis
0 stars 0 forks source link

Polyline doesn't receive ClickEvents when the Map has got an ClickHandler #187

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Found in Release:
gwt-maps-1.0.0.zip

Detailed description:
My editable Polyline has got an PolylineClickHandler that works fine. When
I add a ClickHandler to the map, the Polyline only receives click events
for the line, not for the drag-markers:

    private class ClickHandler implements PolylineClickHandler {        
        public void onClick(PolylineClickEvent event) {
            lastClickedVertex = -1;

            for (int i = 0; i < line.getVertexCount(); i++) {
                if (event.getLatLng().distanceFrom(line.getVertex(i)) == 0) {
                    lastClickedVertex = i;
                }
            }

            if (lastClickedVertex == -1) {
                onLineClicked();
            } else {
                onVertexClicked(lastClickedVertex);
            }
        }
    }

Workaround if you have one:
none :(

Links to the relevant GWT Developer Forum posts:

Original issue reported on code.google.com by claudius...@googlemail.com on 7 Oct 2008 at 8:59

GoogleCodeExporter commented 9 years ago

Original comment by galgwt.reviews@gmail.com on 7 Oct 2008 at 8:41

GoogleCodeExporter commented 9 years ago
The next step on this one would be to try to reproduce the problem in the 
JavaScript API.

Original comment by galgwt.reviews@gmail.com on 13 Oct 2008 at 8:05

GoogleCodeExporter commented 9 years ago
Could you reproduce the problem? I'm using MacOS 10.5.5, perhaps it depends on 
the
gwt-version for mac, since nobody had this problem untill now.

Original comment by claudius...@googlemail.com on 14 Oct 2008 at 10:45

GoogleCodeExporter commented 9 years ago
I created a small project (attached) and couldn't reproduce the problem on 
either
Linux or MacOS 10.5.5.   As you click on the map, polyline, or polyline vertex, 
a
debug message is written below the map.

Note that it is expected behavior for both the Map click handler and the 
Polyline
click handler to fire when there is a click over a polyline.

  http://code.google.com/apis/maps/documentation/reference.html#GPolyline

I did notice that the pointer behavior is a bit strange.  This would have to be 
an
issue with the JavaScript Maps API.

Original comment by galgwt.reviews@gmail.com on 14 Oct 2008 at 12:36

Attachments: