Created
June 14, 2011 11:29
-
-
Save feedhenry-gists/1024718 to your computer and use it in GitHub Desktop.
Tutorial Sencha Touch Mapping Lookup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get location using Geolocation API | |
$fh.geo({interval: 0}, function (res) { | |
// Got geolocation details in response. Pass them into map api, initialising map at that point | |
$fh.map({ | |
target: '#maps_div', | |
lat: res.lat, | |
lon: res.lon, | |
zoom: 15 | |
}, function (res) { | |
// Map is being shown, no need to do anything here | |
}, function (error) { | |
// something seriously wrong here. Show error | |
... | |
}); | |
}, function (error) { | |
// Problem getting geolocation details, so fallback to hardcoded values | |
$fh.map({ | |
target: '#maps_div', | |
lat: 53.5, // Hardcoded values for lat & lon as fallbacks | |
lon: -7.5, | |
zoom: 15 | |
}, function (res) { | |
// Map is being shown, no need to do anything here | |
}, function (error) { | |
// something seriously wrong here. Show error | |
... | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment