wisemapping-frontend/packages/editor/test/playground/map-render/js/MapInfoImpl.ts

69 lines
1.7 KiB
TypeScript
Raw Permalink Normal View History

/*
* Copyright [2021] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
* "powered by wisemapping" text requirement on every single page;
* you may not use this file except in compliance with the License.
* You may obtain a copy of the license at
*
* http://www.wisemapping.org/license
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { MapInfo } from '../../../../src';
class MapInfoImpl implements MapInfo {
private id: string;
private title: string;
private locked: boolean;
private starred: boolean;
2023-01-06 18:11:12 +01:00
private lockedMsg: string | undefined;
2023-01-06 18:11:12 +01:00
constructor(id: string, title: string, locked: boolean, lockedMsg?: string) {
this.id = id;
this.title = title;
this.locked = locked;
2023-01-06 18:11:12 +01:00
this.lockedMsg = lockedMsg;
this.starred = true;
}
isStarred(): Promise<boolean> {
return Promise.resolve(this.starred);
}
updateStarred(value: boolean): Promise<void> {
this.starred = value;
return Promise.resolve();
}
getTitle(): string {
return this.title;
}
setTitle(value: string): void {
2023-01-06 18:11:12 +01:00
throw (this.title = value);
}
isLocked(): boolean {
return this.locked;
}
getLockedMessage(): string {
return 'Map Is Locked !';
}
getZoom(): number {
return 0.8;
}
getId(): string {
return this.id;
}
}
export default MapInfoImpl;