Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Touch pan with Google is not working (iPad) #1198

Open
carypeebles opened this issue Dec 10, 2013 · 2 comments
Open

Touch pan with Google is not working (iPad) #1198

carypeebles opened this issue Dec 10, 2013 · 2 comments

Comments

@carypeebles
Copy link

I am having trouble with the touch navigation when using a Google base map. The issues seem to be reproducible in the online examples - I've tried http://openlayers.org/dev/examples/google.html and http://openlayers.org/dev/examples/all-overlays-google.html and both exhibit jerky pan behavior on my iPad.
The samples are using "Release 2.14 dev", my app is using"Release 2.13".

@carypeebles
Copy link
Author

Has anyone else experienced this issue? I've tried 2.12 and 2.13 in my app with Google v3 release.

@carypeebles
Copy link
Author

This simple html page illustrates the issue I am having - I have been using an iPad with Safari and Chrome


<!DOCTYPE html> 
<html>
<head profile="http://www.w3.org/2005/10/profile">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <script src="http://maps.google.com/maps/api/js?v=3&amp;sensor=false"></script>
    <script type="text/javascript" src="http://dev.openlayers.org/releases/OpenLayers-2.13.1/lib/OpenLayers.js"></script>
    <script type="text/javascript">
        var map = null;
        var points = [
                    new OpenLayers.Geometry.Point(-122.395089, 37.793819),
                    new OpenLayers.Geometry.Point(-122.395095, 37.793821),
                    new OpenLayers.Geometry.Point(-122.3933, 37.795),
                    new OpenLayers.Geometry.Point(-122.396622, 37.793745),
                    new OpenLayers.Geometry.Point(-122.393936, 37.792514),
                    new OpenLayers.Geometry.Point(-122.39735999999999, 37.794042999999995),
                    new OpenLayers.Geometry.Point(-122.39399999999999, 37.79215),
                    new OpenLayers.Geometry.Point(-122.393643, 37.792128),
                    new OpenLayers.Geometry.Point(-122.39433899999999, 37.791882),
                    new OpenLayers.Geometry.Point(-122.392848, 37.792265),
                    new OpenLayers.Geometry.Point(-122.3977, 37.7932),
                    new OpenLayers.Geometry.Point(-122.398062, 37.793949),
                    new OpenLayers.Geometry.Point(-122.393614, 37.791753),
                    new OpenLayers.Geometry.Point(-122.39400699999999, 37.791528),
                    new OpenLayers.Geometry.Point(-122.39845199999999, 37.794412),
                    new OpenLayers.Geometry.Point(-122.39339, 37.791575),
                    new OpenLayers.Geometry.Point(-122.39809899999999, 37.792949),
                    new OpenLayers.Geometry.Point(-122.398479, 37.793703),
                    new OpenLayers.Geometry.Point(-122.398585, 37.794138),
                    new OpenLayers.Geometry.Point(-122.39860499999999, 37.793819),
                    new OpenLayers.Geometry.Point(-122.399149, 37.788103)
                ];
                
        function addMarkers(asVector) {
            var icon = new OpenLayers.Icon('http://www.openlayers.org/dev/img/marker.png', new OpenLayers.Size(21, 25), null, 
                function(size) { return new OpenLayers.Pixel(-(size.w/2), -size.h); });
        
            var layername = "Markers";
            var srs = "EPSG:4326";
            var dataProjection = new OpenLayers.Projection(srs); 
            var mapProjection = map.projection;
            
            var layer;
            if (asVector) {
                layer = new OpenLayers.Layer.Vector(layername, {projection: mapProjection}); 
            } else {
                layer = new OpenLayers.Layer.Markers(layername);
            }
            map.addLayer(layer);
            for (var i = 0; i < points.length; i++) {
                var point = points[i].transform(dataProjection, mapProjection);
                if (asVector) {
                    layer.addFeatures(new OpenLayers.Feature.Vector(point));
                } else {
                    layer.addMarker(new OpenLayers.Marker(new OpenLayers.LonLat(point.x, point.y),icon.clone()));
                }
            }
            map.zoomToExtent(layer.getDataExtent(), true);
        };
        function init() {
            map = new OpenLayers.Map('map', {
                projection: 'EPSG:3857',
                layers: [new OpenLayers.Layer.Google(
                    "Google Streets",
                    {numZoomLevels: 20}
                    )],
                center: new OpenLayers.LonLat(-122.395, 37.79406).transform('EPSG:4326', 'EPSG:3857'),
                zoom: 18
            });
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            //for (var i=map.layers.length-1; i>=0; --i) {
            //  map.layers[i].animationEnabled = this.checked;
            //}
            addMarkers(false);
        };
    </script>
</head>
<body onload="init()">
<div id="map" style="width: 768px;height: 480px;border: 1px solid #ccc;">
</div>
</body>
</html>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant