summaryrefslogtreecommitdiff
path: root/plugins/Mapstraction/usermap.js
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-19 10:51:46 -0500
committerEvan Prodromou <evan@status.net>2009-11-19 10:51:46 -0500
commitecc1bd6130a291a46a50a05bcb8992f3f4e9c57a (patch)
tree5fc1c56cd08b14ec7803830ad1fde87f7b9ccad5 /plugins/Mapstraction/usermap.js
parentb657e49ec772aec2b60ae193252edd53d85e1df5 (diff)
first steps towards usermaps
Diffstat (limited to 'plugins/Mapstraction/usermap.js')
-rw-r--r--plugins/Mapstraction/usermap.js39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/Mapstraction/usermap.js b/plugins/Mapstraction/usermap.js
new file mode 100644
index 000000000..169686a50
--- /dev/null
+++ b/plugins/Mapstraction/usermap.js
@@ -0,0 +1,39 @@
+$(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;
+ }
+ }
+
+ var myPoint = new mxn.LatLonPoint(minLat + Math.abs(maxLat - minLat)/2,
+ minLon + Math.abs(maxLon - minLon)/2);
+
+ // display the map centered on a latitude and longitude (Google zoom levels)
+
+ mapstraction.setCenterAndZoom(myPoint, 9);
+});