getting MapZoomEndedEvent values in Custom View
Hi, I am looking for help in finding out whether something wrong in my code or the result is expected.
I subscribe the “MapZoomEndedEvent” so when users zoom in/out the HTML 5 viewer map I will get Extent, zoomFactor, anchor, and level from the event. According to GVH Commands & Events (https://docs.geocortex.com/essentials/gvh/latest/commands-help/index.html#/events/Map/MapZoomEndedEvent) four values should be in the event. However, from the Chrome Developer debugger, the “evt” contains only one value - the extent.
Chrome Debugger shows this:
this.app.eventRegistry.event("MapZoomEndedEvent").subscribe(this,function (evt) { evt: Object { xmin: -13570694.452932538, ymin: 4488121.809822625, xmax: -13570014.28281356}
This is the code segment I have in the view model:
interface MyMapZoomEndedEvent {
extent: Extent;
zoomFactor: number;
anchor: Point;
level: number;
}
export class AddDraggableLabelsViewModel extends ViewModelBase {
app: ViewerApplication;
initialize() {
this.app.eventRegistry.event("MapZoomEndedEvent").subscribe(this, (evt: MyMapZoomEndedEvent) => {
this.app.command("Alert").execute("zoomed factor = {0}, zoomed level={1}".format(evt.zoomFactor, evt.level));
});
};
}
Thank you in advance.
Du måste logga in om du vill lämna en kommentar.
Kommentarer
0 kommentarer