Skip to content

Instantly share code, notes, and snippets.

@Ledragon
Last active December 29, 2015 16:47
Show Gist options
  • Save Ledragon/f85340778bb5bb2d7ba9 to your computer and use it in GitHub Desktop.
Save Ledragon/f85340778bb5bb2d7ba9 to your computer and use it in GitHub Desktop.
Test of the map framework
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Framework test</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://cdn.rawgit.com/Ledragon/LeDragon-MapFramework/master/dist/LeDragon-Framework.css" rel="stylesheet" />
<body>
<div class="container-fluid">
<div class="row">
<div class="col-xs-4">
<div class="panel panel-primary">
<div class="panel-heading">
Orthographic
</div>
<div class="panel-body">
<div id="test"></div>
</div>
</div>
</div>
<div class="col-xs-7">
<div class="panel panel-primary">
<div class="panel-heading">Mercator</div>
<div class="panel-body">
<div id="mercator"></div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.12/d3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.6/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/q.js/1.0.1/q.js"></script>
<script src="https://cdn.rawgit.com/Ledragon/LeDragon-MapFramework/master/dist/framework.client.js"></script>
<script src="https://cdn.rawgit.com/Ledragon/LeDragon-MapFramework/master/dist/framework.server.js"></script>
<script src="ortho.js"></script>
<script src="mercator.js"></script>
</body>
</html>
var logger = LeDragon.Framework.Utilities.loggerFactory.getLogger('app');
try {
var mercator = new LeDragon.Framework.Map.map('#mercator', d3);
mercator.type(0);
var reader = new LeDragon.Framework.Map.Services.countriesReaderService(d3);
reader.get110m()
.then(function (countries) {
mercator.drawCountries(countries);
mercator.addPosition(5, 50);
mercator.addPosition(-112, 37, 'red');
})
.catch(function (error) {
logger.errorFormat(error);
});
} catch (e) {
logger.errorFormat(e);
}
var logger = LeDragon.Framework.Utilities.loggerFactory.getLogger('app');
try {
var ortho = new LeDragon.Framework.Map.map('#test', d3);
var reader = new LeDragon.Framework.Map.Services.countriesReaderService(d3);
reader.get110m()
.then(function (countries) {
ortho.drawCountries(countries);
ortho.addPosition(5, 50);
ortho.addPosition(-112, 37, 'red');
})
.catch(function (error) {
logger.errorFormat(error);
});
} catch (e) {
logger.errorFormat(e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment