Skip to content
Permalink
Browse files

Admin Interface (WIP)

- Survey panel
- Geofence panel
  • Loading branch information...
robin-dekkers committed Jul 11, 2019
1 parent 120795f commit 20614fb688a82378bc79fd609090d843da2c6f90
@@ -46,7 +46,8 @@ class OrHeader extends LitElement {
}
#logo {
height: 60px;
margin: var(--header-logo-margin, 0);
height: var(--header-logo-height, 60px);
display: block;
}
@@ -12,7 +12,7 @@ export const orInputStyle = css`
font-size: 14px;
border-bottom: 2px solid #d5d5d5;
background-color: #f2f2f2;
background-color: var(--or-input-background, #f2f2f2);
}
input:invalid { border-bottom: 2px solid red;}
@@ -4,9 +4,14 @@ import {LngLatLike, Map as MapGL, MapboxOptions as OptionsGL, Marker as MarkerGL
MapMouseEvent} from "mapbox-gl";
import L, {Map as MapJS, MapOptions as OptionsJS, Marker as MarkerJS} from "mapbox.js";
import {Type, ViewSettings} from "./index";
import {OrMapMarker, OrMapMarkerClickedEvent} from "./markers/or-map-marker";
import {OrMapMarker, OrMapMarkerChangedEvent, OrMapMarkerClickedEvent} from "./markers/or-map-marker";
import {getLatLng, getLatLngBounds, getLngLat, getLngLatBounds} from "./util";

// TODO were to place this
// fix any type
const metersToPixelsAtMaxZoom = (meters:number, latitude:number) =>
meters / 0.075 / Math.cos(latitude * Math.PI / 180);

export class MapWidget {
protected static _mapboxGlStyle?: any;
protected static _mapboxJsStyle?: any;
@@ -214,11 +219,14 @@ export class MapWidget {
if (marker.lat && marker.lng) {
if (marker._actualMarkerElement) {
this._updateMarkerPosition(marker);
this._createMarkerRadius(marker);
} else {
this._updateMarkerElement(marker, true);

}
} else if (marker._actualMarkerElement) {
this._updateMarkerElement(marker, false);

}
break;
}
@@ -295,12 +303,51 @@ export class MapWidget {
if (marker.interactive) {
this._addMarkerClickHandler(marker, mGl.getElement());
}

}
}
break;
}
}

protected _createMarkerRadius(marker:OrMapMarker){
if(this._mapGl && marker.radius && marker.lat && marker.lng){
// this._mapGl.addSource('circleData', {
// type: 'geojson',
// data: {
// type: 'FeatureCollection',
// features: [{
// type: "Feature",
// geometry: {
// "type": "Point",
// "coordinates": [marker.lng, marker.lat]
// },
// properties: {
// "title": "You Found Me",
// }
// }]
// }
// });
//
// this._mapGl.addLayer({
// "id":"marker-radius-circle",
// "type": "circle",
// "source": "circleData",
// "paint": {
// "circle-radius": {
// stops: [
// [5, 1],
// [15, 1024]
// ],
// base: 2
// },
// "circle-color": "red",
// "circle-opacity": 0.6
// }
// });
}
}

protected _addMarkerClickHandler(marker: OrMapMarker, elem: HTMLElement) {
if (elem) {
const handler = (ev: MouseEvent) => {
@@ -107,6 +107,9 @@ export class OrMapMarker extends LitElement {
@property({type: Number, reflect: true})
public lng?: number;

@property({type: Number, reflect: true})
public radius?: number;

@property({type: Boolean})
public visible: boolean = true;

@@ -92,6 +92,7 @@ class OrSmartNotify extends LitElement {
this.smartNotify.attributes.SMART_NOTIFY_ENABLED.value = null;
this.isActive = false;
}

REST.api.AssetResource.update(this.smartNotify.id, this.smartNotify).then((response: any) => {
console.log("Setting Smart Notify");
this.smartNotify.version = this.smartNotify.version + 1;

0 comments on commit 20614fb

Please sign in to comment.
You can’t perform that action at this time.