-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when yaga-marker is updated on disabled layer #382
Comments
I cannot reproduce this error. Maybe you run other code in addition? FYI: While reading the structure of your HTML code, I guess you want to use the Do you still have an error? Can you provide me some more code or circumstances? |
I will close this issue. If you still have problems feel free to reopen this issue again... |
Hi @atd-schubert.
import { Component, Input } from '@angular/core';
import { CRS, latLng, LatLngBounds, Util } from 'leaflet';
import { LayerProvider, LayersControlProvider, LayerGroupProvider } from '@yaga/leaflet-ng2';
import * as L from 'leaflet';
@Component({
providers: [LayerProvider, LayersControlProvider, LayerGroupProvider],
selector: 'indoor-map',
template: `<div>
<yaga-map [zoom]="0" [minZoom]="0" [maxZoom]="5" [maxBounds]="bounds" [draggingEnabled]="draggable" [boxZoomEnabled]="true" [crs]="crs">
<yaga-zoom-control>
<yaga-layers-control>
<yaga-layer-group yaga-overlay-layer="Layer">
<ul>
<li *ngFor="let obj of objs">
<yaga-marker [lat]="200" [lng]="100">
<yaga-icon [iconUrl]="'https://upload.wikimedia.org/wikipedia/commons/a/ac/Approve_icon.svg'" [iconSize]="objSize">
<yaga-tooltip [content]="obj.label"></yaga-tooltip>
</yaga-icon>
</yaga-marker>
</li>
</ul>
</yaga-layer-group>
<yaga-image-overlay [url]="'http://dondodge.typepad.com/.a/6a00d8341bf9da53ef017d4287d90c970c-pi'" [bounds]="bounds">
</yaga-image-overlay>
</yaga-layers-control>
</yaga-zoom-control>
</yaga-map>
</div>`,
styles: ['.yaga-map {width: 1280px;height: 1024px;}']
})
export class IndoorMapComponent {
public objs: Label[] = [];
public objSize: L.Point = new L.Point(48, 48);
public crs: CRS = Util.extend(CRS.Simple, {
transformation: new L.Transformation(1, 0, 1, 0)
});
public bounds: LatLngBounds = new LatLngBounds(latLng(0, 0), latLng(1024, 1280));
constructor() {
this.objs = [new Label('label')];
setInterval(() => {
this.objs = [new Label('label')];
}, 1000);
}
}
export class Label {
public label: string;
constructor(label: string) {
this.label = label;
}
} Just disable Layer in the layer control and monitor the browser's console. I did not find how to reopen the issue (may be I have no permissions). Could you do it please? |
Hi All,
I use the following HTML template.
obj
is updated periodically. When I disableLayer
through the layer control, updates fail with the errorCould you fix it please?
The text was updated successfully, but these errors were encountered: