Skip to content

Commit

Permalink
Merge pull request #333 from GIScience/release-v0.5.2
Browse files Browse the repository at this point in the history
Release v0.5.2
  • Loading branch information
TheGreatRefrigerator authored May 12, 2020
2 parents c0837be + e605da8 commit c267738
Show file tree
Hide file tree
Showing 19 changed files with 97 additions and 115 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Deprecated
### Removed-->

## [v0.5.2] - 2020-05-12

### Fixed
- avoid features & polygons not working for isochrones
### Changed
- isochrones endpoint to V2 API
### Removed
- Mapsurfer baselayer

## [v0.5.1] - 2020-05-07

### Added
Expand Down
4 changes: 2 additions & 2 deletions Gruntfile.default.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ module.exports = function(grunt) {
directions:
"http://localhost:3005/ors/v2/directions",
isochrones:
"http://localhost:3005/ors/isochrones",
"http://localhost:3005/ors/v2/isochrones",
matrix:
"http://localhost:3005/ors/matrix",
pois:
Expand All @@ -298,7 +298,7 @@ module.exports = function(grunt) {
directions:
"https://api.openrouteservice.org/v2/directions",
isochrones:
"https://api.openrouteservice.org/isochrones",
"https://api.openrouteservice.org/v2/isochrones",
matrix: "https://api.openrouteservice.org/matrix",
pois: "https://api.openrouteservice.org/pois",
shortenlink: "https://api-ssl.bitly.com/v3/shorten",
Expand Down
9 changes: 7 additions & 2 deletions app/components/ors-header/ors-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ angular.module("orsApp.ors-header", []).component("orsHeader", {
angular.forEach(Object.keys(ctrl.currentOptions.env), key => {
ctrl.envBase = "https://api.openrouteservice.org";
ctrl.currentOptions.env[key] = ctrl.envBase + "/";
ctrl.currentOptions.env[key] +=
key === "directions" ? "v2/" + key : key;
ctrl.currentOptions.env[key] += [
"directions",
"isochrones",
"matrix"
].includes(key)
? "v2/" + key
: key;
});
} else if (fill === "default") {
angular.forEach(Object.keys(ctrl.currentOptions.env), key => {
Expand Down
8 changes: 1 addition & 7 deletions app/components/ors-map/ors-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ angular.module("orsApp").directive("orsMap", () => {
let ak = "?api_key=" + apiKey;

$scope.translateFilter = $filter("translate");
const mapsurfer = L.tileLayer(ENV.mapsurfer + ak, {
attribution: orsNamespaces.layerMapSurfer.attribution,
id: 0
});
const bkgtopplus = L.tileLayer.wms(orsNamespaces.layerBkgTopPlus.url, {
layers: "web",
format: "image/png",
Expand Down Expand Up @@ -397,7 +393,7 @@ angular.module("orsApp").directive("orsMap", () => {
orsCookiesFactory.getMapOptions() &&
orsCookiesFactory.getMapOptions().msi
? orsCookiesFactory.getMapOptions().msi
: 0;
: 3;

// mapOptionsInitSubject is a replay subject and only subscribes once
let mapInitSubject = orsSettingsFactory.mapOptionsInitSubject.subscribe(
Expand Down Expand Up @@ -514,7 +510,6 @@ angular.module("orsApp").directive("orsMap", () => {
setSettings();
};
$scope.baseLayers = {
OpenMapSurfer: mapsurfer,
"TopPlus-Web-Open": bkgtopplus,
"TopPlus-Web-Open Greyscale": bkgtopplusgrey,
OpenStreetMap: openstreetmap,
Expand All @@ -530,7 +525,6 @@ angular.module("orsApp").directive("orsMap", () => {
// add mapstyle
angular.forEach($scope.baseLayers, (value, key) => {
if (value.options.id === $scope.mapStyleId) {
console.log($scope.mapStyleId, $scope.baseLayers);
$scope.baseLayers[key].addTo($scope.orsMap);
}
});
Expand Down
2 changes: 1 addition & 1 deletion app/components/ors-navigation/ors-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ angular
if ($location.path() === "/") {
ctrl.activeMenu = "/directions";
} else ctrl.activeMenu = $location.path();
ctrl.version = "0.5.1";
ctrl.version = "0.5.2";
}
],
$routeConfig: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<div ng-repeat="isochroneResponse in $ctrl.aaQueries track by isochroneResponse.info.timestamp;">
<ors-aa-query attributes="isochroneResponse" intervals-length="$ctrl.aaQueries[$index].features.length" isochrone-idx="$index" on-add="$ctrl.add(obj)" on-de-emph="$ctrl.deEmph()" on-delete="$ctrl.deleteQuery(isoidx)" on-download="$ctrl.downloadQuery(isoidx)" on-emph="$ctrl.emph(isoidx,isonum)" on-share="$ctrl.shareQuery(shareUrl)" on-toggle="$ctrl.toggle(obj)" on-toggle-interval="$ctrl.toggleInterval(obj)" on-zoom="$ctrl.zoomTo(isoidx, isonum)">
<div ng-repeat="isochroneResponse in $ctrl.aaQueries track by isochroneResponse.metadata.timestamp;">
<ors-aa-query
attributes="isochroneResponse"
intervals-length="$ctrl.aaQueries[$index].features.length"
isochrone-idx="$index" on-add="$ctrl.add(obj)"
on-de-emph="$ctrl.deEmph()" on-delete="$ctrl.deleteQuery(isoidx)"
on-download="$ctrl.downloadQuery(isoidx)"
on-emph="$ctrl.emph(isoidx,isonum)"
on-share="$ctrl.shareQuery(shareUrl)"
on-toggle="$ctrl.toggle(obj)"
on-toggle-interval="$ctrl.toggleInterval(obj)"
on-zoom="$ctrl.zoomTo(isoidx, isonum)">
</ors-aa-query>
</div>
<ors-modal data-ng-if="$ctrl.showExport" show="$ctrl.showExport">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="ors-aa-query">
<div class="segment">
<div class="summary" ng-mouseout="$ctrl.deEmph();" ng-mouseover="$ctrl.emph();">
<div class="ui label tiny block margin-bottom-3" ng-switch="$ctrl.attributes.info.query.range_type">
<div class="ui label tiny block margin-bottom-3" ng-switch="$ctrl.attributes.metadata.query.range_type">
<span ng-bind-html="$ctrl.isochroneIdx + 1">
</span>
<span ng-bind-html="'-'">
Expand All @@ -11,9 +11,9 @@
<span ng-bind-html="('DISTANCE' | translate)" ng-switch-when="distance">
</span>
<div class="detail">
<span ng-bind-html="($ctrl.attributes.info.query.ranges[$ctrl.attributes.info.query.ranges.length-1] | distance:true)" ng-switch-when="distance">
<span ng-bind-html="($ctrl.attributes.metadata.query.range[0] | distance:true)" ng-switch-when="distance">
</span>
<span ng-bind-html="$ctrl.attributes.info.query.ranges[$ctrl.attributes.info.query.ranges.length-1]/60" ng-switch-when="time">
<span ng-bind-html="$ctrl.attributes.metadata.query.range[0]/60" ng-switch-when="time">
</span>
<span ng-bind-html="'min'" ng-switch-when="time">
</span>
Expand All @@ -29,7 +29,7 @@
<i ng-class="$ctrl.show()" tooltip-append-to-body="true" tooltip-side="top" tooltip-template="{{('TOGGLESHOW' | translate)}}" tooltips="">
</i>
</span>
<span ng-click="$ctrl.zoomTo($ctrl.attributes.info.query.ranges.length-1);">
<span ng-click="$ctrl.zoomTo($ctrl.attributes.metadata.query.range[0]);">
<i class="fa fa-expand" tooltip-append-to-body="true" tooltip-side="top" tooltip-template="{{('EXPAND' | translate)}}" tooltips="">
</i>
</span>
Expand All @@ -44,7 +44,7 @@
</div>
</div>
<div class="segment" ng-mouseout="$ctrl.deEmph();" ng-mouseover="$ctrl.emph();">
<div class="icon" ng-switch="$ctrl.attributes.info.query.profile">
<div class="icon" ng-switch="$ctrl.attributes.metadata.query.profile">
<div ng-switch-when="driving-car">
<i class="fa fa-lg fa-car">
</i>
Expand All @@ -67,7 +67,7 @@
</div>
</div>
<div class="waypoint">
<h4 ng-bind-html="$ctrl.attributes.info.address">
<h4 ng-bind-html="$ctrl.attributes.metadata.address">
</h4>
</div>
<div class="opacitySlider">
Expand All @@ -84,7 +84,7 @@ <h4 ng-bind-html="$ctrl.attributes.info.address">
<div class="collapsable" ng-class="{ showMe: showIsochrones }">
<table class="ui celled teal compact small table">
<thead>
<tr ng-switch="$ctrl.attributes.info.query.range_type">
<tr ng-switch="$ctrl.attributes.metadata.query.range_type">
<th>
<span ng-bind-html="('RANGE' | translate)">
</span>
Expand All @@ -93,7 +93,7 @@ <h4 ng-bind-html="$ctrl.attributes.info.address">
<span ng-bind-html="('AREA' | translate)">
</span>
</th>
<th ng-switch-when="time">
<th>
<span ng-bind-html="('REACHFACTOR' | translate)">
</span>
</th>
Expand All @@ -109,25 +109,31 @@ <h4 ng-bind-html="$ctrl.attributes.info.address">
</tr>
</thead>
<tbody align="right">
<tr class="pointer" ng-class="{highlight: hover}" ng-click="$ctrl.zoomTo($index); $event.stopPropagation();" ng-mouseout="$ctrl.deEmph(); hover=false;" ng-mouseover="$ctrl.emph($index); hover=true;" ng-repeat="isochrone in $ctrl.attributes.info.query.ranges" ng-switch="$ctrl.attributes.info.query.range_type">
<tr class="pointer"
ng-class="{highlight: hover}"
ng-click="$ctrl.zoomTo($index); $event.stopPropagation();"
ng-mouseout="$ctrl.deEmph(); hover=false;"
ng-mouseover="$ctrl.emph($index); hover=true;"
ng-repeat="isochrone in $ctrl.attributes.features"
ng-switch="$ctrl.attributes.metadata.query.range_type">
<td>
<span ng-bind-html="(isochrone | distance:true)" ng-switch-when="distance">
<span ng-bind-html="(isochrone.properties.value | distance:true)" ng-switch-when="distance">
</span>
<span ng-bind-html="(isochrone/60)" ng-switch-when="time">
<span ng-bind-html="(isochrone.properties.value/60)" ng-switch-when="time">
</span>
<span ng-bind-html="'min'" ng-switch-when="time">
</span>
</td>
<td>
<span ng-bind-html="($ctrl.attributes.features[$index].properties.area | area)">
<span ng-bind-html="(isochrone.properties.area | area)">
</span>
</td>
<td ng-switch-when="time">
<span ng-bind-html="($ctrl.attributes.features[$index].properties.reachfactor | number: 2)">
<td>
<span ng-bind-html="(isochrone.properties.reachfactor | number: 2)">
</span>
</td>
<td>
<span ng-bind-html="($ctrl.attributes.features[$index].properties.total_pop)">
<span ng-bind-html="(isochrone.properties.total_pop)">
</span>
</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ angular.module("orsApp.ors-aa-query", []).component("orsAaQuery", {
ctrl.toggleInterval = (intervalIdx, event) => {
event.preventDefault();
event.stopPropagation();
let reverseIndex =
ctrl.attributes.info.query.ranges.length - 1 - intervalIdx;
let reverseIndex = ctrl.attributes.features.length - 1 - intervalIdx;
ctrl.onToggleInterval({
obj: {
isoidx: ctrl.isochroneIdx,
Expand Down
8 changes: 1 addition & 7 deletions app/constants/lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,13 +271,7 @@ angular.module("orsApp").constant("lists", {
},
fords: {
name: "fords",
subgroups: [
"Car",
"Bicycle",
"HeavyVehicle",
"Wheelchair",
"Pedestrian"
]
subgroups: ["Bicycle", "Wheelchair", "Pedestrian"]
},
steps: {
name: "steps",
Expand Down
9 changes: 0 additions & 9 deletions app/constants/namespaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,6 @@ angular.module("orsApp").constant("orsNamespaces", {
keywords: "Openrouteservice. Routing. GIS. Universität Heidelberg",
src: "Route point logged using Openrouteservice"
},
/**
* map layers used on the openlayers map
*/
//url to Open Map Surfer layer
layerMapSurfer: {
url: "https://api.openrouteservice.org/mapsurfer/{z}/{x}/{y}.png",
attribution:
'Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, powered by <a href="http://mapsurfernet.com/">MapSurfer.NET</a>'
},
//url to hillshade overlay
layerHs:
"https://korona.geog.uni-heidelberg.de/tiles/asterh/x={x}&y={y}&z={z}",
Expand Down
31 changes: 2 additions & 29 deletions app/infrastructure/ors-aa-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ angular.module("orsApp.aa-service", []).factory("orsAaService", [
action = orsObjectsFactory.createMapAction(
34,
lists.layers[5],
isochronesObj.info.query.locations[0],
isochronesObj.metadata.query.locations[0],
idx
);
orsMapFactory.mapServiceSubject.onNext(action);
Expand Down Expand Up @@ -186,7 +186,7 @@ angular.module("orsApp.aa-service", []).factory("orsAaService", [
orsAaService.processResponse = (data, settings) => {
orsAaService.orsAaObj = data;
// add geocode address
orsAaService.orsAaObj.info.address = settings.waypoints[0]._address;
orsAaService.orsAaObj.metadata.address = settings.waypoints[0]._address;
// reverse order, needed as leaflet ISO 6709
for (let i = 0; i < orsAaService.orsAaObj.features.length; i++) {
for (
Expand All @@ -199,39 +199,12 @@ angular.module("orsApp.aa-service", []).factory("orsAaService", [
].reverse();
}
}
// split ranges into list
orsAaService.orsAaObj.info.query.ranges = orsAaService.orsAaObj.info.query.ranges.split(
","
);
orsAaService.aaSubject.onNext(orsAaService.orsAaObj);
};
/** Subscription function to current aa responses object, used in panel. */
orsAaService.subscribeToAaQueries = o => {
return orsAaService.aaSubject.subscribe(o);
};
/**
* Requests accessiblity analysis from ORS backend
* @param {String} requestData: XML for request payload
*/
orsAaService.getIsochrones = requestData => {
var url = ENV.isochrones;
var canceller = $q.defer();
var cancel = reason => {
canceller.resolve(reason);
};
var promise = $http
.get(url, {
params: requestData,
timeout: canceller.promise
})
.then(response => {
return response.data;
});
return {
promise: promise,
cancel: cancel
};
};
return orsAaService;
}
]);
2 changes: 1 addition & 1 deletion app/infrastructure/ors-importexport-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ angular
// create a simple Course TCX file (MARQ24)
// see https://www8.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd
let toTcx = (name, speedInKmPerH) => {
let version = "0.5.1";
let version = "0.5.2";
let pointInformation =
orsRouteService.data.features[orsRouteService.getCurrentRouteIdx()]
.point_information;
Expand Down
23 changes: 0 additions & 23 deletions app/infrastructure/ors-route-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,6 @@ angular.module("orsApp.route-service", []).factory("orsRouteService", [
}
orsRouteService.routingRequests.requests = [];
};
/**
* Requests route from ORS backend
* @param {String} requestData: XML for request payload
*/
orsRouteService.fetchRoute = requestData => {
let url = ENV.directions;
const canceller = $q.defer();
const cancel = reason => {
canceller.resolve(reason);
};
url += `/${requestData.profile}/${requestData.geometry_format}`;
delete requestData.profile;
delete requestData.geometry_format;
const promise = $http
.post(url, requestData, { timeout: canceller.promise })
.then(response => {
return response.data;
});
return {
promise: promise,
cancel: cancel
};
};
orsRouteService.setCurrentRouteIdx = idx => {
orsRouteService.currentRouteIdx = idx;
};
Expand Down
4 changes: 2 additions & 2 deletions app/infrastructure/ors-settings-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ angular.module("orsApp.settings-service", []).factory("orsSettingsFactory", [
orsRouteService.resetRoute();
const userOptions = orsSettingsFactory.getUserOptions();
const payload = orsUtilsService.routingPayload(settings, userOptions);
const request = orsRouteService.fetchRoute(payload);
const request = orsUtilsService.createRequest("directions", payload);
orsRouteService.routingRequests.requests.push(request);
request.promise.then(
function(response) {
Expand Down Expand Up @@ -280,7 +280,7 @@ angular.module("orsApp.settings-service", []).factory("orsSettingsFactory", [
/** Cancel outstanding requests */
orsAaService.aaRequests.clear();
const payload = orsUtilsService.isochronesPayload(settings);
const request = orsAaService.getIsochrones(payload);
const request = orsUtilsService.createRequest("isochrones", payload);
orsAaService.aaRequests.requests.push(request);
request.promise.then(
function(response) {
Expand Down
Loading

0 comments on commit c267738

Please sign in to comment.