@goteborgco/open-api-js-client
Version:
Official JavaScript client for the Göteborg & Co GraphQL API
49 lines (48 loc) • 1.15 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Markers = exports.Feature = exports.Geometry = exports.Properties = void 0;
/**
* Properties for a map marker
*/
class Properties {
constructor(data) {
this.name = data.name;
this.id = data.id;
this.icon = data.icon;
this.thumbnail = data.thumbnail;
this.type = data.type;
this.slug = data.slug;
}
}
exports.Properties = Properties;
/**
* Geometry information for a map marker
*/
class Geometry {
constructor(data) {
this.type = data.type;
this.coordinates = data.coordinates;
}
}
exports.Geometry = Geometry;
/**
* A feature on the map
*/
class Feature {
constructor(data) {
this.type = data.type;
this.geometry = new Geometry(data.geometry);
this.properties = new Properties(data.properties);
}
}
exports.Feature = Feature;
/**
* Collection of map markers
*/
class Markers {
constructor(data) {
this.type = data.type;
this.features = data.features?.map((f) => new Feature(f)) || [];
}
}
exports.Markers = Markers;