Why is the setCenter implementation incompatible with a mobile laptop?

I have very simple code that works fine on my laptop running Chrome, but not on my Android browser (Gingerbread 2.3.6):

window.addEventListener("resize", handleResize, false);
//define Map ("map") and LatLng ("myLoc")
function handleResize() {
    if( map != null ) {
        map.setCenter(myLoc);
        //test to see if device knows it has been resized
        var w1 = $(mapDiv).width();
        alert(w1 + " " + myLoc);
    }
}

As you can see, all I'm doing is trying to reposition after a resize event. Any idea why this is not working on my phone? (And, yes, the phone knows that it has been changed.)

+3
source share

All Articles