ddubrava / angular-yandex-maps

🗺️ Yandex.Maps Angular components that implement the Yandex.Maps JavaScript API
https://ddubrava.github.io/angular8-yandex-maps/#/
MIT License
57 stars 7 forks source link

❓ - Zoom duraction #247

Closed 14837-eng closed 1 month ago

14837-eng commented 1 month ago

Description

How can I adjust the zoom on custom buttons so that it is smooth?

I can do this in the react library, but how can I do it in the current library? Updating the counter does not give smoothness :(

image

Library name

ddubrava commented 1 month ago

Hi! Have you tried this component https://ddubrava.github.io/angular-yandex-maps/#/v3/components/YMapZoomControlDirective?id=ymapzoomcontroldirective? Or do you mean you need controls outside the map?

14837-eng commented 1 month ago

@ddubrava I mean my button component which is located behind the map (non-standard control)

ddubrava commented 1 month ago

You need to pass a duration property to props.location.

<div class="container">
  <y-map
    (ready)="onMapReady($event)"
    [props]="{
      location: {
        center: [-0.127696, 51.507351],
        zoom,
        duration: 200,
      },
    }"
  >
    <y-map-default-scheme-layer />
  </y-map>
</div>

<button (click)="onZoom(1)">Zoom In</button>
<button (click)="onZoom(-1)">Zoom Out</button>
14837-eng commented 1 month ago

thx