2009-11-20 00:51:46 +09:00
|
|
|
$(document).ready(function() {
|
|
|
|
var mapstraction = new mxn.Mapstraction("map_canvas", _provider);
|
|
|
|
|
|
|
|
var minLat = 181.0;
|
|
|
|
var maxLat = -181.0;
|
|
|
|
var minLon = 181.0;
|
|
|
|
var maxLon = -181.0;
|
|
|
|
|
|
|
|
for (var i in _notices)
|
|
|
|
{
|
|
|
|
var n = _notices[i];
|
|
|
|
|
|
|
|
var lat = n['geo']['coordinates'][0];
|
|
|
|
var lon = n['geo']['coordinates'][1];
|
|
|
|
|
|
|
|
if (lat < minLat) {
|
|
|
|
minLat = lat;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lat > maxLat) {
|
|
|
|
maxLat = lat;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lon < minLon) {
|
|
|
|
minLon = lon;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lon > maxLon) {
|
|
|
|
maxLon = lon;
|
|
|
|
}
|
|
|
|
|
2009-11-20 01:51:15 +09:00
|
|
|
pt = new mxn.LatLonPoint(lat, lon);
|
|
|
|
mkr = new mxn.Marker(pt);
|
|
|
|
|
|
|
|
mkr.setIcon(n['user']['profile_image_url']);
|
2009-11-20 03:20:55 +09:00
|
|
|
mkr.setInfoBubble('<a href="'+ n['user']['profile_url'] + '">' + n['user']['screen_name'] + '</a>' + ' ' + n['html'] +
|
|
|
|
'<br/><a href="'+ n['url'] + '">'+ n['created_at'] + '</a>');
|
2009-11-20 01:51:15 +09:00
|
|
|
|
|
|
|
mapstraction.addMarker(mkr);
|
|
|
|
}
|
2009-11-20 00:51:46 +09:00
|
|
|
|
2009-11-20 01:51:15 +09:00
|
|
|
bounds = new mxn.BoundingBox(minLat, minLon, maxLat, maxLon);
|
2009-11-20 00:51:46 +09:00
|
|
|
|
2009-11-20 01:51:15 +09:00
|
|
|
mapstraction.setBounds(bounds);
|
2009-11-20 00:51:46 +09:00
|
|
|
});
|