fysoul17 / google_maps_place_picker

Place picker on Google Maps for Flutter
MIT License
222 stars 357 forks source link

onMapCreated is not called #99

Open SchnMar opened 3 years ago

SchnMar commented 3 years ago

Describe the bug The onMapCreated isn't called by the package.

To Reproduce add something like this and you will see:

onMapCreated: (GoogleMapController controller) {
        print('map created');
},

Expected behavior GoogleMapController can be used for own interaction with map. Need this to set my own custom style for the map.

Nuhel commented 3 years ago

As I i read the code, I think the call back will never be called. See the code below This is the code from google_map_place_picker.dart file. 149 number line. where the google map is being created. onMapCreated: (GoogleMapController controller) { provider.mapController = controller; provider.setCameraPosition(null); provider.pinState = PinState.Idle;

          // When select initialPosition set to true.
          if (selectInitialPosition) {
            provider.setCameraPosition(initialCameraPosition);
            _searchByCameraLocation(provider);
          }
        }
Navarad commented 3 years ago

I think we can add onMapCreated?.call(controller); at the end of the callback

nirjanmunshi commented 3 years ago

Is there any other way to handle the zoom level of the map? Since onMapCreated is not working, it is not possible to set the zoom level as well. So if possible, let me know if there is some other way to set the zoom level.

giorgio79 commented 1 year ago

possibly related https://github.com/fysoul17/google_maps_place_picker/issues/178