hansemannn / titanium-googlemaps

🗺 Use the Google Maps SDK in Titanium
Other
87 stars 26 forks source link

regionchanged event does not return actual zoom level #59

Closed bitfabrikken closed 7 years ago

bitfabrikken commented 7 years ago

Thanks for a great module :)

If you add a "regionchanged" listener to a map, and the users zooms, the event is indeed triggered. But the zoom value is not returned in the parameters, nor does it seems to be possible to get the zoom level, directly from map.region.zoom.

The reason I could use this feature, is for saving the zoom level the user has zoomed to, and restoring it upon app restart.

Here's a sample of the parameters returned by "regionchanged":

{
    "map": {
        "horizontalWrap": true,
        "visible": true,
        "touchEnabled": true,
        "region": {
            "longitude": 8.90640377998352,
            "latitude": 55.646722718901046
        }
    },   
    "longitude": 16.439600363373756,
    "latitude": 38.40440099227222,
    "bubbles": true,
    "type": "regionchanged",
    "source": {
        "horizontalWrap": true,
        "visible": true,
        "touchEnabled": true,
        "region": {
            "longitude": 8.90640377998352,
            "latitude": 55.646722718901046
        }
    },   
    "cancelBubble": false
}
hansemannn commented 7 years ago

Good catch! And fixed immediately in this commit, together with bearing and viewingAngle. New version 2.6.1 coming now.

bitfabrikken commented 7 years ago

That's the fastest fix I've ever seen! Thanks @hansemannn :)

hansemannn commented 7 years ago

Yeahhh - https://github.com/hansemannn/ti.googlemaps/releases/tag/v2.6.1