I'm making a map with openlayers. For the navigation on the iPhone I added OpenLayers.Control.Navigation(), so zoom and pan work fine. On the desktop, i can click a marker and a popup appears. But on the phone nothing happens?

Any suggestions?

map = new OpenLayers.Map("map", {projection: mercator,
    controls: [

        new OpenLayers.Control.LayerSwitcher(),
        new OpenLayers.Control.Navigation(),
        new OpenLayers.Control.ZoomPanel(),
        new OpenLayers.Control.MouseDefaults()

        units: 'meters',

temp = tCoord(lon, lat);
        var feature = new OpenLayers.Feature(markerLayer, temp);
        feature.closeBox = true;
        feature.popupClass = OpenLayers.Class(OpenLayers.Popup.Anchored, {minSize: new OpenLayers.Size(320, 100)} );
        feature.data.popupContentHTML = "<div class=\"infoWindow\"><strong>" + name +"</strong> <br/>" + desc 
                                        +"<br><a href=\"#\" onclick=\"routing(new OpenLayers.LonLat("+lon+","+ lat+"))\">Route hierher</a></div>";
        feature.data.overflow = "hidden";

        var tempMarker = new OpenLayers.Marker(temp, icon.clone());
        tempMarker.feature = feature;
         tempMarker.events.register("mousedown", feature, markerClick);
        allPoints.push(new Array(zeilenCounter, tempMarker));

(tCoord transforms from wgs84 to spherical mercator)


first of all use OpenLayers.Mobile library for developing mobile application, here. and then checkout these if u consider or not.

  1. <meta name="apple-mobile-web-app-capable" content="yes">
  2. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
  3. controls in map options:

      controls: [
        new OpenLayers.Control.TouchNavigation({
            dragPanOptions: {
                enableKinetic: true
        new OpenLayers.Control.Zoom(),

beside this you can glance at openlayers mobile jquery app here as to some viewpoint.

i hope it helps you...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.