summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@dfupdate.se>2023-05-11 23:25:33 +0200
committerMarcus Lundblad <ml@dfupdate.se>2023-05-11 23:25:33 +0200
commitc85fbcdda1514ede67d0e6c73f55b75b94d615ff (patch)
tree6a04dd7c7475b979409f219408881deb7cccf895
parent0a7c21b3b7ada0a3ed37a13d8d99404f9dd420de (diff)
downloadgnome-maps-c85fbcdda1514ede67d0e6c73f55b75b94d615ff.tar.gz
overpass: Remove addInfo() methodwip/mlundblad/overpass-populate-place-callback
-rw-r--r--src/overpass.js39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/overpass.js b/src/overpass.js
index 56e06004..8bbd562c 100644
--- a/src/overpass.js
+++ b/src/overpass.js
@@ -36,13 +36,11 @@ const _DEFAULT_OUTPUT_SORT_ORDER = 'qt';
const BASE_URL = 'https://overpass-api.de/api/interpreter';
-export class Overpass extends GObject.Object {
+export class Overpass {
constructor(params) {
params = params || { };
- super();
-
// maximum allowed runtime for the query in seconds
this.timeout = params.timeout || _DEFAULT_TIMEOUT;
@@ -65,30 +63,6 @@ export class Overpass extends GObject.Object {
this._session = new Soup.Session({ user_agent : 'gnome-maps/' + pkg.version });
}
- addInfo(place) {
- let url = this._getQueryUrl(Utils.osmTypeToString(place.osm_type),
- place.osm_id);
- let request = Soup.Message.new('GET', url);
-
- this._session.send_and_read_async(request, GLib.PRIORITY_DEFAULT, null,
- (source, res) => {
- if (request.get_status() !== Soup.Status.OK) {
- Utils.debug('Failed to fetch Overpass result: ' +
- request.get_status());
- return;
- }
- try {
- let buffer = this._session.send_and_read_finish(res).get_data();
- let jsonObj = JSON.parse(Utils.getBufferText(buffer));
- this._populatePlace(place, jsonObj);
- this.place = place;
- this.notify('place');
- } catch(e) {
- Utils.debug('Failed to parse Overpass result');
- }
- });
- }
-
populatePlace(place, callback) {
let url = this._getQueryUrl(Utils.osmTypeToString(place.osm_type),
place.osm_id);
@@ -266,14 +240,3 @@ export class Overpass extends GObject.Object {
}
}
-GObject.registerClass({
- Properties: {
- 'place': GObject.ParamSpec.object('place',
- 'Place',
- 'Place with added information',
- GObject.ParamFlags.READABLE |
- GObject.ParamFlags.WRITABLE,
- Geocode.Place)
- }},
- Overpass
-);