Browse files

made working example

  • Loading branch information...
1 parent dfa6ce7 commit f40c6072b0893d2b0ee45b6ecb2c99d8ded6f636 @jrasky jrasky committed Apr 10, 2012
View
14 README.rst
@@ -1,15 +1,7 @@
+Introduction
+------------
-GeocamLayer is a library for web mapping that enables efficient browsing
-of massive sets of map placemarks.
-
-Its Python/Django server component provides a map feed which answers
-location-specific queries. When the query covers a wide map area, it
-performs server-side clustering of placemarks to keep the response size
-bounded regardless of the overall size of the data set.
-
-Its JavaScript client component, built on the Google Maps API,
-automatically performs the queries needed to populate the map with
-placemarks and clusters based on the map viewport.
+The point of the geocamLayer project is to provide a server-side application that performs the tasks of managing and clustering points on a map, reducing to a minimum the client-side requirements in the area of processing power. This application provides a json and a kml interface, which both account for clustering automatically. The code itself is designed to be easy to integrate into existing projects, as the view method that generates the clusters is completely autonomous, and includes no database interactions. Documentation of the exact format is included below.
Dependencies:
View
BIN example/database.db
Binary file not shown.
View
24 geocamLayer/static/geocamLayer/static_tiles.js
@@ -2,7 +2,7 @@ function initialize() {
window.map = new google.maps.Map(document.getElementById("map_canvas"), {zoom: 6, mapTypeId: google.maps.MapTypeId.ROADMAP});
//google.maps.event.addListener(map,'bounds_changed',getClusters);
window.points = new Array();
- //window.bboxes = new Object();
+ window.bboxes = new Object();
window.conn = null;
//window.updating = false;
//window.concurent = false;
@@ -75,14 +75,20 @@ function processTile() {
parsed = JSON.parse(conn.responseText);
clearPoints();
console.log(parsed);
- for (xcell in parsed) {
- for (ycell in parsed[xcell]) {
- for (point in parsed[xcell][ycell]) {
- pos = point['coordinates'];
- console.log(parsed[xcell][ycell][point]);
- marker = new google.maps.Market({position:new google.maps.LatLng(pos)});
- points[points.length] = marker;
+ for (x in parsed['features']) {
+ cluster = parsed['features'][x];
+ console.log(cluster);
+ pos = cluster['geometry']['coordinates'].toString().split(',');
+ marker = new google.maps.Marker({position:new google.maps.LatLng(pos[0], pos[1]), map:map, clickable:true, icon:new google.maps.MarkerImage(url='/static/arrow.png')});
+ bboxes[new google.maps.LatLng(pos[0], pos[1])] = cluster['properties']['bbox'];
+ google.maps.event.addListener(marker,"click",function(event){
+ clearPoints();
+ bbox = bboxes[event.latLng];
+ bounds = new google.maps.LatLngBounds(new google.maps.LatLng(bbox[0],bbox[1]),
+ new google.maps.LatLng(bbox[2],bbox[3]));
+ map.fitBounds(bounds);
}
- }
+ );
+ points[cluster.length] = marker;
}
}
View
1 geocamLayer/static/geocamLayer/static_tiles_test.html
@@ -3,7 +3,6 @@
<title>Static Tile HTML Test</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
- <script type="text/javascript" src="http://code.google.com/apis/gears/gears_init.js"></script>
<script type="text/javascript" src="static_tiles.js"></script>
</head>
<body onload="initialize()">

0 comments on commit f40c607

Please sign in to comment.