sparnatural
Version:
Visual client-side SPARQL query builder and knowledge graph exploration tool
61 lines (60 loc) • 1.92 kB
TypeScript
import L, { LatLng } from "leaflet";
import { AddUserInputBtn } from "../buttons/AddUserInputBtn";
import { AbstractWidget, WidgetValue } from "./AbstractWidget";
import "leaflet/dist/leaflet.css";
import "@geoman-io/leaflet-geoman-free";
import "@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css";
import { SelectedVal } from "../SelectedVal";
import { NamedNode } from '@rdfjs/types/data-model';
import { HTMLComponent } from '../HtmlComponent';
export declare const GEOFUNCTIONS: {
WITHIN: NamedNode<string>;
};
export declare const GEOSPARQL: {
WKT_LITERAL: NamedNode<string>;
};
export declare class MapValue implements WidgetValue {
value: {
label: string;
type: string;
coordinates: LatLng[][];
};
key(): string;
constructor(v: MapValue["value"]);
exportToGeoJson(): object;
}
type ObjectifyLatLng<T> = T extends LatLng[][] ? [[{
lat: number;
lng: number;
}]] : T extends object ? {
[k in keyof T]: ObjectifyLatLng<T[k]>;
} : T;
type ObjectMapWidgetValue = ObjectifyLatLng<MapValue>;
export interface MapConfiguration {
zoom: number;
center: {
lat: number;
long: number;
};
}
export interface CustomControlOptions {
name: string;
block: any;
title: string;
className: string;
onClick: () => void;
}
export default class MapWidget extends AbstractWidget {
#private;
static defaultConfiguration: MapConfiguration;
protected configuration: MapConfiguration;
protected endClassWidgetGroup: any;
protected widgetValues: MapValue[];
renderMapValueBtn: AddUserInputBtn;
map: L.Map;
drawingLayer: L.Layer;
constructor(configuration: MapConfiguration, parentComponent: HTMLComponent, startClassVal: SelectedVal, objectPropVal: SelectedVal, endClassVal: SelectedVal);
render(): this;
parseInput(input: ObjectMapWidgetValue["value"]): MapValue;
}
export {};