Skip to content

Commit

Permalink
Merge pull request #187 from OnroerendErfgoed/develop
Browse files Browse the repository at this point in the history
preparing release 1.3.2
  • Loading branch information
cedrikv authored Dec 5, 2023
2 parents a40c9ac + 0037188 commit 215597f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
12 changes: 12 additions & 0 deletions MapController.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ define([
return this.geoJsonFormatter.writeGeometry(geom);
},

transformBoundingboxToMapExtent: function(boundingbox) {
var lowerleft = this.transformLatLonToPoint(boundingbox.lowerleft.lat, boundingbox.lowerleft.lon);
var upperright = this.transformLatLonToPoint(boundingbox.upperright.lat, boundingbox.upperright.lon);
return ([lowerleft.getCoordinates()[0], lowerleft.getCoordinates()[1],
upperright.getCoordinates()[0], upperright.getCoordinates()[1]]);
},

transformLatLonToPoint: function(lat, lon) {
var point = new ol.geom.Point([ lon, lat ]);
return (point.transform('EPSG:4326', 'EPSG:31370'));
},

_createLayers: function(map) {
/* base layers */
var baseLayers = [];
Expand Down
18 changes: 10 additions & 8 deletions ZoneMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,25 +269,27 @@ define([
var crabNode = domConstruct.create("div");
ZoomTab.addContent(crabNode);
var crabZoomer = crabpyWidget.createCrabZoomer(crabNode);
crabZoomer.startup();
var self = this;

var zoomButton = domConstruct.create("a", {
href: "#",
title: "Zoom naar adres",
'class': "button tiny expand",
innerHTML: "Zoom naar adres",
onclick: function (evt) {
onclick: lang.hitch(this, function (evt) {
evt.preventDefault();
var bbox = crabZoomer.getBbox();
if (bbox) {
self.mapController.zoomToExtent(bbox);
if (self.mapController.olMap.getView().getZoom() > 15) {
self.mapController.olMap.getView().setZoom(15);
var bboxobject = crabZoomer.getBbox();
if (bboxobject) {
var bbox = this.mapController.transformBoundingboxToMapExtent(bboxobject);
this.mapController.zoomToExtent(bbox);
if (this.mapController.olMap.getView().getZoom() > 15) {
this.mapController.olMap.getView().setZoom(15);
}
crabZoomer.reset();
sidebar.collapse();
}
}
})
});
ZoomTab.addContent(zoomButton);

Expand All @@ -313,7 +315,7 @@ define([
}

if (this.config.sidebar.draw) {
var drawTab = sidebar.createTab('Bepaal zone', 'fa-connectdevelop', 'Bepaal hier de zone.');
var drawTab = sidebar.createTab('Bepaal zone', 'fa-pencil', 'Bepaal hier de zone.');

/* ZONE */
var zonePane = domConstruct.create('div');
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dojo": "~1.12.1",
"dijit": "~1.12.1",
"proj4": "~2.3.15",
"crabpy_dojo": "https://github.com/OnroerendErfgoed/crabpy_dojo.git#0.2.0",
"crabpy_dojo": "https://github.com/OnroerendErfgoed/crabpy_dojo.git#1.4.3",
"ol": "https://github.com/OnroerendErfgoed/ol3-amd.git#0.2.1",
"font-awesome": "~4.6.3",
"dgrid": "~1.1.0",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"Widget",
"Openlayers"
],
"version": "1.3.1",
"version": "1.3.2",
"repository": {
"type": "git",
"url": "https://github.com/OnroerendErfgoed/zoneerder"
Expand Down

0 comments on commit 215597f

Please sign in to comment.