Closed sa-va closed 3 years ago
ΠΈ ΠΊΠ°ΠΊ Π² angular8-yandex-maps v11.0.1 ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ bounds ΠΊΠ°ΡΡΡ? ΡΠ΅ΠΌ Π·Π°ΠΌΠ΅Π½ΠΈΡΡ ΠΊΠΎΠ΄? public onLoad(event: ILoadEvent) { this.mapComponent = event.instance; }
Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ Π»ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ Π² lazy-loaded ΠΌΠΎΠ΄ΡΠ»Π΅ Ρ ΠΊΠ°ΡΡΠΎΠΉ (Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΌΠ΅ΡΠΊΠΈ Ρ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠΌ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ΠΌ)
myIconContentLayout = ymaps.templateLayoutFactory.createClass( '<div style="color: #FFFFFF; font-weight: bold;">$[properties.iconContent]</div>' );
? ΠΏΠΎΡΠ²Π»ΡΠ΅ΡΡΡ ΠΎΡΠΈΠ±ΠΊΠ° "ReferenceError: ymaps is not defined"
angular8-yandex-maps v11.0.1
<ya-map (ready)="onReady($event)">
public onReady(e: YaReadyEvent<ymaps.Map>): void {
const { ymaps, target } = e;
const CustomLayoutClass = ymaps.templateLayoutFactory.createClass(
'<ul>' +
'{% for name in properties.names %}' +
'<li>{{ name }}</li>' +
'{% endfor %}' +
'</ul>',
);
const placemark = new ymaps.Placemark(
[55.74, 37.58],
{ names: ['Logan', 'Sofia', 'Mason', 'Layla'] },
// any as IPlacemarkOptions is missing balloonContentLayout
{ balloonContentLayout: CustomLayoutClass } as any,
);
target.geoObjects.add(placemark);
}
ΠΈ ΠΊΠ°ΠΊ Π² angular8-yandex-maps v11.0.1 ΡΡΡΠ°Π½ΠΎΠ²ΠΈΡΡ bounds ΠΊΠ°ΡΡΡ? ΡΠ΅ΠΌ Π·Π°ΠΌΠ΅Π½ΠΈΡΡ ΠΊΠΎΠ΄? public onLoad(event: ILoadEvent) { this.mapComponent = event.instance; }
public onReady(e: YaReadyEvent<ymaps.Map>): void {
const { target } = e;
target.setBounds(...);
}
Π²ΠΎΠ·ΠΌΠΎΠΆΠ½ΠΎ Π»ΠΈ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°Π½ΠΈΠ΅ Π² lazy-loaded ΠΌΠΎΠ΄ΡΠ»Π΅ Ρ ΠΊΠ°ΡΡΠΎΠΉ (Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΌΠ΅ΡΠΊΠΈ Ρ ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΡΠΌ ΠΈΠ·ΠΎΠ±ΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ΠΌ)
? ΠΏΠΎΡΠ²Π»ΡΠ΅ΡΡΡ ΠΎΡΠΈΠ±ΠΊΠ° "ReferenceError: ymaps is not defined"
angular8-yandex-maps v11.0.1