forked from 0x2620/oxjs
update geo tools
This commit is contained in:
parent
7035e207c2
commit
204f083e98
2 changed files with 346 additions and 17 deletions
|
|
@ -64,7 +64,7 @@
|
|||
<script>
|
||||
/*
|
||||
this adds the properties
|
||||
area, east, imageURL, lat, lng, north, south, west
|
||||
area, east, lat, lng, north, south, west
|
||||
*/
|
||||
Ox.load('UI', {debug: true}, function() {
|
||||
Ox.getJSON('../json/geo.json', function(geo) {
|
||||
|
|
@ -222,8 +222,11 @@
|
|||
var addresses = geo.google_query[country.name] || [country.name],
|
||||
length = addresses.length,
|
||||
union;
|
||||
// fixme: this might be too much data
|
||||
// check if map really needs this preloaded
|
||||
// (and even if, country markers may not be necessary)
|
||||
getImageURLs(country, function(imageURLs) {
|
||||
$.extend(country, {
|
||||
Ox.extend(country, {
|
||||
imageURLs: imageURLs
|
||||
});
|
||||
callGeocode();
|
||||
|
|
@ -273,14 +276,14 @@
|
|||
}
|
||||
}
|
||||
function getImageURLs(country, callback) {
|
||||
Ox.print(country, '../png/marker/32/' + country.code + '.png')
|
||||
Ox.print(country, '../png/icon/16/' + country.code + '.png')
|
||||
var image = new Image();
|
||||
image.onload = function() {
|
||||
callback({
|
||||
marker: Ox.canvas(image).canvas.toDataURL()
|
||||
icon16: Ox.canvas(image).canvas.toDataURL()
|
||||
});
|
||||
};
|
||||
image.src = '../png/markers/32/' + country.code + '.png';
|
||||
image.src = '../png/icons/16/' + country.code + '.png';
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue