Skip to content

Click events for openlayers seem to not be working with Android 4 devices #268

@doppi

Description

@doppi

When using the code below with my desktop browser (Chrome) it indeed works with both openlayers and googlev3.
I have tested the same code with two Android 4 devices (one mobile and one tablet) and the problem is the same i.e. it only works with googlev3, but the Android 4 problem with openlayers is the same with either using Chrome or Firefox.
(there seem to never be a response to the click events at the markers since no javascript alert is displayed)

So, since the problem seem to exist in only Android 4 devices (well, at least not in my Windows 7 desktop browser) and in different Android browsers (Chrome and Firefox) and only in openlayers but not googlev3,
then I think the problem should be a bug in the code for either mapstraction or openlayers.
(I have not tested the openlayers API directly since I just started to experiment with a mapping API and then chose the mapstraction API, i.e. I am not familiar with how to use openlayers API directly)

If this problem is a known limitation and there is some known workaround for how to make marker clicks in openlayers work with android 4 devices too, then I would suggest some added information about marker clicks for openlayers at these pages:
https://github.com/mapstraction/mxn/wiki/Map-Provider-Gotchas
http://mapstraction.com/tutorial/markers
http://mapstraction.com/tutorial/events

The code I have been testing with:
var mapstraction = new mxn.Mapstraction('map', 'openlayers'); // if using 'googlev3' instead then it works for Android 4 browsers
var marker = new mxn.Marker(new mxn.LatLonPoint(51.50733, -0.12769));
marker.click.addHandler(function(eventName, eventSource, eventArgs) {
alert("The marker was clicked");
});
mapstraction.addMarker(marker);
mapstraction.autoCenterAndZoom();

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions