kopia lustrzana https://github.com/robhawkes/vizicities
coords from url hash
rodzic
62387679fd
commit
43619e5df6
|
@ -30,7 +30,7 @@
|
|||
|
||||
var city = new VIZI.City();
|
||||
city.init({
|
||||
coords: [-0.01924, 51.50358] // Canary Wharf
|
||||
// coords: [-0.01924, 51.50358] // Canary Wharf
|
||||
// coords: [-0.1159894466, 51.5045487479] // London Eye
|
||||
// coords: [-73.984762, 40.7516199] // NYC (performance-heavy)
|
||||
});
|
||||
|
|
|
@ -53,6 +53,12 @@
|
|||
options = {};
|
||||
}
|
||||
|
||||
var hash = window.location.hash.replace('#', '');
|
||||
var coordCheck = /^(\-?\d+(\.\d+)?),(\-?\d+(\.\d+)?)$/;
|
||||
if (coordCheck.test(hash) && !_.has(options, 'coords')) {
|
||||
options.coords = hash.split(',');
|
||||
}
|
||||
|
||||
_.defaults(options, {
|
||||
coords: [-0.01924, 51.50358]
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue