Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected initMarkerView(): void {
let markerView = this.getChildView("marker") as MapCircleView | null;
if (!markerView) {
markerView = new MapCircleView();
markerView.center.setState(new LngLat(this._info.lng, this._info.lat));
markerView.radius.setState(Length.px(5));
markerView.fill.setState(this._view!.intersectionMarkerColor.value!);
markerView.on("click", this.onMarkerClick.bind(this));
this.setChildView("marker", markerView);
}
}
protected initMarkerView(): void {
let markerView = this.getChildView("marker") as MapCircleView | null;
if (!markerView && this._boundingBoxLink) {
const boundingBox = this._boundingBoxLink.get().toAny() as unknown as AgencyBoundingBox | undefined;
if (boundingBox) {
const lng = (boundingBox.minLng + boundingBox.maxLng) / 2;
const lat = (boundingBox.minLat + boundingBox.maxLat) / 2;
markerView = new MapCircleView();
markerView.center.setState(new LngLat(lng, lat));
markerView.radius.setState(Length.px(10));
markerView.fill.setState(this._view!.agencyMarkerColor.value!);
markerView.on("click", this.onMarkerClick.bind(this));
this.setChildView("marker", markerView);
}
}
}