Search in sources :

Example 1 with MyLocationMenuController

use of net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.MyLocationMenuController in project Osmand by osmandapp.

the class MenuController method getMenuController.

public static MenuController getMenuController(MainActivity mainActivity, LatLon latLon, PointDescription pointDescription, Object object, MenuType menuType) {
    SampleApplication app = mainActivity.getMyApplication();
    MenuController menuController = null;
    if (object != null) {
        if (object instanceof Amenity) {
            menuController = new AmenityMenuController(mainActivity, pointDescription, (Amenity) object);
        } else if (object instanceof LatLon) {
            if (pointDescription.isMyLocation()) {
                menuController = new MyLocationMenuController(mainActivity, pointDescription);
            }
        }
    }
    if (menuController == null) {
        menuController = new PointDescriptionMenuController(mainActivity, pointDescription);
    }
    menuController.menuType = menuType;
    menuController.setLatLon(latLon);
    return menuController;
}
Also used : SampleApplication(net.osmand.core.samples.android.sample1.SampleApplication) Amenity(net.osmand.data.Amenity) LatLon(net.osmand.data.LatLon) AmenityMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.AmenityMenuController) MyLocationMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.MyLocationMenuController) PointDescriptionMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.PointDescriptionMenuController) AmenityMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.AmenityMenuController) PointDescriptionMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.PointDescriptionMenuController) MyLocationMenuController(net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.MyLocationMenuController)

Aggregations

SampleApplication (net.osmand.core.samples.android.sample1.SampleApplication)1 AmenityMenuController (net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.AmenityMenuController)1 MyLocationMenuController (net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.MyLocationMenuController)1 PointDescriptionMenuController (net.osmand.core.samples.android.sample1.mapcontextmenu.controllers.PointDescriptionMenuController)1 Amenity (net.osmand.data.Amenity)1 LatLon (net.osmand.data.LatLon)1