Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42913c8
commit 904e3dc
Showing
9 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js" type="text/javascript"></script> | ||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> | ||
<script data-main="js/geojson" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.17/require.min.js"></script> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="jumbotron hidden-xs"> | ||
<h1 style="text-align:center">Marker Cluster - GeoJSON</h1> | ||
</div> | ||
<div class="row"> | ||
<div class="col-sm-3"> | ||
<h4>Projection</h4> | ||
<div class="dropdown" id="projectionDropdown"> | ||
</div> | ||
<br> | ||
<h4>Layers</h4> | ||
<div class="list-group" id="layerList"> | ||
</div> | ||
<br> | ||
<h4>Destination</h4> | ||
<div class="input-group" id="searchBox"> | ||
<input type="text" class="form-control" placeholder="GoTo" id="searchText"/> | ||
<span class="input-group-btn"> | ||
<button id="searchButton" class="btn btn-primary" type="button"> | ||
<span class="glyphicon glyphicon-search"></span> | ||
</button> | ||
</span> | ||
</div> | ||
</div> | ||
<div class="col-sm-9" id="globe"> | ||
<canvas id="canvasOne" width="1000" height="1000" style="width: 100%; height: auto"> | ||
Your browser does not support HTML5 Canvas. | ||
</canvas> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
var markerClusterUSCities; | ||
requirejs(['../libraries/WorldWind/WorldWind', | ||
'../example/js/LayerManager', '../src/MarkerCluster'], | ||
function (ww, | ||
LayerManager, MarkerCluster) { | ||
"use strict"; | ||
|
||
|
||
WorldWind.Logger.setLoggingLevel(WorldWind.Logger.LEVEL_WARNING); | ||
WorldWind.configuration.baseUrl = "libraries/WorldWind/"; | ||
var wwd = new WorldWind.WorldWindow("canvasOne"); | ||
|
||
var layers = [ | ||
{layer: new WorldWind.BingAerialWithLabelsLayer(null), enabled: true}, | ||
{layer: new WorldWind.CompassLayer(), enabled: true}, | ||
{layer: new WorldWind.CoordinatesDisplayLayer(wwd), enabled: true} | ||
]; | ||
var viewControlsLayer = new WorldWind.ViewControlsLayer(wwd); | ||
|
||
for (var l = 0; l < layers.length; l++) { | ||
layers[l].layer.enabled = layers[l].enabled; | ||
layers[l].layer.detailControl = 1; | ||
wwd.addLayer(layers[l].layer); | ||
} | ||
wwd.addLayer(viewControlsLayer); | ||
|
||
markerClusterUSCities = new MarkerCluster(wwd, { | ||
name: "US Cities", | ||
controls: viewControlsLayer, | ||
maxLevel: 7 | ||
}); | ||
|
||
getJSON('data/usCities.json', function (results) { | ||
results.forEach(function (city) { | ||
var p = markerClusterUSCities.newPlacemark( | ||
[city.latitude, city.longitude], | ||
null, | ||
{label: city.city} | ||
); | ||
markerClusterUSCities.add(p); | ||
}); | ||
markerClusterUSCities.generateCluster(); | ||
}); | ||
|
||
|
||
var layerManager = new LayerManager(wwd); | ||
|
||
function getJSON(url, callback) { | ||
var xhr = new XMLHttpRequest(); | ||
xhr.open('GET', url, true); | ||
xhr.responseType = 'json'; | ||
xhr.setRequestHeader('Accept', 'application/json'); | ||
xhr.onload = function () { | ||
if (xhr.readyState === 4 && xhr.status >= 200 && xhr.status < 300 && xhr.response) { | ||
callback(xhr.response); | ||
} | ||
}; | ||
xhr.send(); | ||
} | ||
}) | ||
; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters