Skip to content

Commit

Permalink
Fix mapnificent map integration
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbl committed Apr 13, 2019
1 parent 1d20d31 commit d62ce89
Show file tree
Hide file tree
Showing 6 changed files with 1,051 additions and 695 deletions.
21 changes: 7 additions & 14 deletions app/public/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,27 +602,20 @@ angular.module('dataVis')

var mapnificent;
var initMapnificent = function() {
var city = {
cityid: "berlin",
cityname: "Berlin",
lat: 52.525592,
lng: 13.369545,
northwest: {"lat":52.755362,"lng":12.901471},
southeast: {"lat":52.295934,"lng":13.909891},
options: {"estimatedMaxCalculateCalls":2100000} || {},
zoom: 11,
dataPath: "http://www.mapnificent.net/data/berlin/"
};
mapnificent = new Mapnificent(map, city, {
baseurl: '/lib/mapnificent/'
mapnificent = new Mapnificent(map, config.transportTimeMapnificentConfig, {
dataPath: `https://cdn.jsdelivr.net/gh/mapnificent/mapnificent_cities/${config.transportTimeMapnificentConfig.cityid}/`,
baseurl: './lib/mapnificent/'
});
mapnificent.init();
}

$scope.showTransportOverlay = function(flat) {
var marker = markers[flat.id];
$scope.transport.visible = flat.id;
currentTransportPos = mapnificent.addPosition(marker, $scope.transport.minutes * 60);
if(currentTransportPos) {
mapnificent.removePosition(currentTransportPos);
}
currentTransportPos = mapnificent.addPosition(marker._latlng, $scope.transport.minutes * 60);
currentTransportPos.setProgressCallback(function(percent) {
$timeout(function() {
$scope.transportLoadingPercentage = percent;
Expand Down
6 changes: 4 additions & 2 deletions app/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
<script src="bower_components/angularjs-slider/dist/rzslider.min.js"></script>
<link rel="stylesheet" href="bower_components/angularjs-slider/dist/rzslider.min.css" type="text/css" media="screen" />
<script src="bower_components/moment/min/moment.min.js"></script>
<script src="lib/mapnificent/quadtree.js"></script>
<script src="lib/mapnificent/mapnificent.js"></script>
<script src="https://cdn.jsdelivr.net/npm/protobufjs@6.8.8/dist/protobuf.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mapnificent/mapnificent@84ce41ced097e01ddc73f24ba95bfd9afb68020e/static/js/quadtree.js"></script>
<script src="./lib/mapnificent/quadtree.js"></script>
<script src="./lib/mapnificent/mapnificent.js"></script>

<script src="/config"></script>
<script src="app.js"></script>
Expand Down
Loading

0 comments on commit d62ce89

Please sign in to comment.