Skip to content

Instantly share code, notes, and snippets.

@feedhenry-gists
Created June 14, 2011 11:29
Show Gist options
  • Save feedhenry-gists/1024718 to your computer and use it in GitHub Desktop.
Save feedhenry-gists/1024718 to your computer and use it in GitHub Desktop.
Tutorial Sencha Touch Mapping Lookup
// 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