UNPKG

@appsensorlike/appsensorlike

Version:

A port of OWASP AppSensor reference implementation

38 lines (37 loc) 929 B
import { AppsensorEntity } from '../core.js'; /** * General object representing geo-location. */ class GeoLocation extends AppsensorEntity { constructor(latitude, longitude) { super(); this.latitude = 0.0; this.longitude = 0.0; this.setLatitude(latitude); this.setLongitude(longitude); } getLatitude() { return this.latitude; } setLatitude(latitude) { this.latitude = latitude; return this; } getLongitude() { return this.longitude; } setLongitude(longitude) { this.longitude = longitude; return this; } equals(obj) { if (!super.equals(obj)) return false; if (this === obj) return true; const other = obj; return this.latitude === other.getLatitude() && this.longitude === other.getLongitude(); } } export { GeoLocation };