Unact / yandex_mapkit

Flutter implementation of YandexMapkit
MIT License
132 stars 148 forks source link

How to implement map padding? #93

Closed akbarpulatov closed 3 years ago

akbarpulatov commented 3 years ago

Logo of Yandex is becoming invisible. Even when setting bounds after drawing polyline. Route is becoming invisible also. Screen Shot 2021-04-02 at 15 45 12

DCrow commented 3 years ago

Hello!

What are you trying to achieve? As far as I know padding is easily achievable using flutters widget Padding Please include an example, where it doesn't work.

akbarpulatov commented 3 years ago

I am using Positioned widget(the same behavior as Padding widget). When i am changing the padding the whole widget tree is re-rendering, as you can see from this video:

https://user-images.githubusercontent.com/27597344/113663670-e03fd180-96c3-11eb-90ea-8063590baefa.mp4

If you see the 2nd video google gives addition parameters as padding:

https://user-images.githubusercontent.com/27597344/113663716-f3eb3800-96c3-11eb-9c0a-46035d55d0c5.mp4

The purpose of this padding is not the padding of the widget, but the padding of bounds of efficient area. For example in Google maps if i set route from Point A to Point B, then i will give some padding of 10 in order to look consistent. In the case of Yandex Map, i am doing some walkaround to achive this. Did you catch the point? if not, please write.

DCrow commented 3 years ago

As I understand your problem is that "Choose on map", "Submit order", etc overlay your route, logo and other stuff in YandexMap? And you want some method to change effective bounds inside the map, so that when you move your camera it should reposition to the center of those new bounds(not to the center of the actual map)?

akbarpulatov commented 3 years ago

Didn't catch you. Can you be more informative?. Please see the video if you did not understand the question.

akbarpulatov commented 3 years ago

move the camera position with controller or with dragging?

DCrow commented 3 years ago

As I saw in the video some interface components(floating ones) overlay your YandexMap objects. Which is why you want some method with which to notify YandexMap that it should center itself differently so that your objects are not overlaid by other floating components.

move the camera position with controller or with dragging?

Programmatically using YandexMapController

akbarpulatov commented 3 years ago

Which is why you want some method with which to notify YandexMap that it should center itself differently so that your objects are not overlaid by other floating components

I mean: Which is why i want some method with which to notify YandexMap so that my yandex map is properly centered, after overlaid by other floating components.

akbarpulatov commented 3 years ago

if you dont understant though, just watch how google label is moving in video without rebuilding the map.

DCrow commented 3 years ago

The only similar method to Googles setPadding is YMKMapWindow.focusRect which is implemented in this library.

If it doesn't help, then you should ask the developers of native YandexMapkit(Android/iOS) to implement such functionality, which in turn can be implemented here.

akbarpulatov commented 3 years ago

The only similar method to Googles setPadding is YMKMapWindow.focusRect which is implemented in this library.

If it doesn't help, then you should ask the developers of native YandexMapkit(Android/iOS) to implement such functionality, which in turn can be implemented here.

Does this method have flutter APIs?

DCrow commented 3 years ago

Yes, this method is implemented here