Intermediate refactoring

This commit is contained in:
Pieter Vander Vennet 2020-07-20 15:59:48 +02:00
parent 93db813cfc
commit 069cddf034
103 changed files with 7950 additions and 0 deletions

22
Logic/Geocoding.js Normal file
View file

@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Geocoding = void 0;
var $ = require("jquery");
var Geocoding = /** @class */ (function () {
function Geocoding() {
}
Geocoding.Search = function (query, basemap, handleResult, onFail) {
var b = basemap.map.getBounds();
console.log(b);
$.getJSON(Geocoding.host + "format=json&limit=1&viewbox=" +
(b.getEast() + "," + b.getNorth() + "," + b.getWest() + "," + b.getSouth()) +
"&accept-language=nl&q=" + query, function (data) {
handleResult(data);
}).fail(function () {
onFail();
});
};
Geocoding.host = "https://nominatim.openstreetmap.org/search?";
return Geocoding;
}());
exports.Geocoding = Geocoding;