-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.html
More file actions
51 lines (43 loc) · 1.47 KB
/
example.html
File metadata and controls
51 lines (43 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<html>
<head>
<script src="js/jquery-1.11.0.min.js"></script>
<script src="js/underscore-min.js"></script>
<script src="js/openlayers/OpenLayers-2.13.1/OpenLayers.js"></script>
<script src="js/HeatmapLayer.js"></script>
<script src="js/geostats.js"></script>
<script src="solrHeatmapLayer.js"></script>
<script type="text/javascript">
jQuery(document).ready(function() {initMap();});
function initMap()
{
// create OSM basemap and heatmap layer
map = new OpenLayers.Map(
{
div: "map",
theme: null,
layers: [new OpenLayers.Layer.OSM("OpenStreetMap")],
center: new OpenLayers.LonLat(0, 0),
zoom: 1
});
// on map pan or zoom we have to send a new solr request
map.events.register("moveend", map, function(){updateHeatmap(map)});
map.events.register("zoomend", map, function(){updateHeatmap(map)});
// generate heatmap on page load
updateHeatmap(map);
}
// http://WorldWideGeoWeb.com has a solr index for over 170,000 kml files
// SolrHeatmapLayer constructor parameters: map object, base url for solr instance, spatial data field name
var solrHeatmapLayer = null;
function updateHeatmap(map)
{
if (!solrHeatmapLayer)
solrHeatmapLayer = new SolrHeatmapLayer(map, "http://worldwidegeoweb.com:8983/solr/kml/select?q*:*", "bbox_rpt");
solrHeatmapLayer.fetch();
}
</script>
</head>
<body>
<h1>Solr Heatmap Layer Example</h1>
<div id='map'></div>
</body>
</html>