zoomToExtent/zoomToScale Issue with Android Chrome Browser

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

zoomToExtent/zoomToScale Issue with Android Chrome Browser

Brian Krebs-3

Have taken over a project from a previous programmer and am having issues using Chrome on an Android phone where it will actually lock up the browser and I have to force stop it.  I debugged by commenting out the code and uncommenting a line at a time and was able to figure out that calling zoomToExtent or zoomToScale(last 2 lines of code) causes the issue.  I downloaded the Opera browser on the same phone and it did not have an issue, so this is something related to Chrome.  Has anyone dealt with this before and figured out a fix?

 

function markCurrentPosition(position)

{

       var currentFeatures = geolocateLayer.getFeaturesByAttribute('current', true);

       geolocateLayer.removeFeatures(currentFeatures);

 

       var pointg = new OpenLayers.Geometry.Point(position.coords.longitude, position.coords.latitude);

       pointg = OpenLayers.Projection.transform(

              pointg,

              new OpenLayers.Projection("EPSG:4326"),

              new OpenLayers.Projection("EPSG:4326")

         

       );

 

       latestGeolocatePoint = pointg;

 

       var errorStyle = {

                     fillColor: '#2980b9',

                     fillOpacity: 0.1,

                     strokeWidth: 0

              };

       var errorCircle = OpenLayers.Geometry.Polygon.createRegularPolygon(

                           pointg, position.coords.accuracy/(Math.PI * 40075020/180), 40, 0);

       var errorCircleFeature = new OpenLayers.Feature.Vector(errorCircle, {current: true}, errorStyle);

 

       var pointStyle = {

               graphicName: 'circle',

               strokeColor: '#3498db',

               strokeWidth: 1,

               fillColor: '#2980b9',

               fillOpacity: 1,

               pointRadius: 4

           };

       var centerPointFeature = new OpenLayers.Feature.Vector(pointg, {current: true}, pointStyle);

 

       geolocateLayer.addFeatures([centerPointFeature, errorCircleFeature]);

 

       var entryMap = document.getElementById('eTicketMap_mapdiv').mapComponent;

       entryMap.map.zoomToExtent(geolocateLayer.getDataExtent());

       entryMap.map.zoomToScale(1913);

}

 


_______________________________________________
Dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/openlayers-dev