0

In my mobile app I want to load MapMyIndia map so that users can select their current location (or any other location) and their destination using a map. We have decided to use MapMyIndia as the mapping service and Flutter for frontend, we have included the mapmyindia_gl version 0.3.1 plugin for this purpose. The code that we are using :

Widget mapMyIndiaWidget() {
        return MapmyIndiaMap(
        zoomGesturesEnabled: true,
        compassEnabled: true,
        myLocationEnabled: true,
        tiltGesturesEnabled: true,
        scrollGesturesEnabled: true,
    initialCameraPosition: const CameraPosition(
        target: LatLng(12.972442, 77.580643),
        zoom: 14.0,
    ),
    onMapCreated: (map) => {
        // mapController = map,
    },
    onMapClick: (point, coordinates) {
        print("onMapClick : $coordinates");
    },
    onMapLongClick: (point, coordinates) {
        print("onMapLongClick : $coordinates");
    },
    onMapError: (code, message) {
        print("onMapError : $message");
    },
    );
}

This works fine for Android version 12 (API level 31) but when we tried running it for lower Android versions we don't see the map at all (location permissions were granted for this App).

We also tried to downgrade the MMI Flutter to mapmyindia_gl 0.2.0 but we still do not see the Map.

enter image description here Please suggest how to resolve this issue.

Tarun Gupta
  • 1,629
  • 1
  • 22
  • 39

1 Answers1

0
onMapCreated: (map) => {
        // mapController = map,
},

Here, you need to uncomment the code and create a local variable for your mapController. I have a dedicated code where I am able to load the map, show the user's current location, and for place search.

Onur Kağan Aldemir
  • 585
  • 1
  • 5
  • 18
  • Can you please share your current location code to me? I have the same issue that my plugins do not work please share it to me on aamit2267@gmail.com for reference. – Amit Agarwal Jun 16 '23 at 14:24