I
I
Igor Bezlepkin2015-11-21 07:35:17
Android
Igor Bezlepkin, 2015-11-21 07:35:17

What should be the overlay?

Hey! I'm trying to make an overlay on top of Yandex maps.
Here is from the documentation

// Получаем объект MapView
final MapView mMapView = (MapView) findViewById(R.id.map);
// Получаем объект MapController
MapController mMapController = mapView.getMapController();
// Получаем объект OverlayManager
OverlayManager mOverlayManager = mMapController.getOverlayManager();
//Добавляем новый слой
mOverlayManager.addOverlay(overlay);

But I don't understand what should be in the overlay variable.
This is not how overlay = (LinearLayout)findViewById(R.id.overlay);
Swears that type android,widget.LinerLayout cannot be in mOverlayManager.addOverlay(overlay);

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2015-11-21
@freeExec

I don’t know exactly how it is, but in web maps, the overlay is no different from the main map, except that it assumes that the main part is transparent there.

M
Mikenzzz, 2015-11-22
@Mikenzzz

Overlay is a layer on your map.
Before adding it, you need to create it:
Overlay overlayName = new Overlay(mMapController)
Then you can create various objects on the map and add them to your layer. At the end you add this layer to the manager:
mOverlayManager.addOverlay(overlayName);
There are examples on github:
https://github.com/yandexmobile/yandexmapkit-android

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question