liodali / osm_flutter

OpenStreetMap plugin for flutter
https://pub.dev/packages/flutter_osm_plugin
MIT License
240 stars 98 forks source link

What causes the map to black out in ios? #502

Open sandun23 opened 9 months ago

sandun23 commented 9 months ago
  1. This flutter_osm_plugin: ^0.39.1 is showing a black screen on iOS devices. But Markers showing. only map is blackscreen.
  2. This error was showing.

flutter - 3.16.9

this showing when loaded.TANGRAM map.cpp:890: setup GL TANGRAM hardware.cpp:60: Driver supports map buffer: 1 TANGRAM hardware.cpp:61: Driver supports vaos: 1 TANGRAM hardware.cpp:62: Driver supports rgb8_rgba8: 1 TANGRAM hardware.cpp:63: Driver supports NPOT texture: 0 TANGRAM hardware.cpp:77: Hardware max texture size 4096 TANGRAM hardware.cpp:78: Hardware max combined texture units 8 TANGRAM map.cpp:210: resize: 670 x 263 ERROR importer.cpp:63: Unable to retrieve 'https://firebasestorage.googleapis.com/v0/b/osm-resources.appspot.com/o/osm-style.zip?alt=media&token=30e0c9fe-af0b-4994-8a73-2d31057014d4': not found WARNING sceneLoader.cpp:607: No source defined in the yaml scene configuration

liodali commented 9 months ago

use our latest rc version: 1.0.0-rc because old version we used tangrams to show map in ios that require to use style file need it for configuration its better to migrate to suggested version

sandun23 commented 9 months ago

I updated to flutter_osm_plugin: ^0.39.1 to flutter_osm_plugin: ^1.0.0-rc.

Then my existing Code has some errors. How I fix that? (this is my first flutter project)

errors in this line (all are not defined.)

here is my code,

`OSMFlutter( onGeoPointClicked: (gp) { StationsService() .getStationDetails() .forEach((k, element) async { if (gp.latitude == double.parse(element.lat) && gp.longitude == double.parse(element.lng)) { // print(element.locationName); // print(element.locationId); // stateController.setStation(element.locationName); stateController.setStationID(element.locationId); await StationsService().getBatteryDetails();

                //This makes map to reset the state(bug)
                // setState(() {
                //   location = element['location'];
                // });

                //Bottom Sheet
                showModalBottomSheet(
                    barrierColor: const Color(0x10000000),
                    enableDrag: true,
                    isScrollControlled: true,
                    backgroundColor: Colors.transparent,
                    shape: const RoundedRectangleBorder(
                      borderRadius: BorderRadius.vertical(
                        top: Radius.circular(25.0),
                      ),
                    ),
                    context: context,
                    builder: (BuildContext context) {
                      return ChargingStationAvailabilityBottomSheet(
                        location: element.locationName,
                        geopoint: LatLng(
                          double.parse(element.lat),
                          double.parse(element.lng),
                        ),
                        totalcabinets: element.total,
                        available: element.free,
                        details: StationsService().getBatteryDetails(),
                      );
                    });
              }
            });
            // print(stations);
          },
          staticPoints: [
            StaticPositionGeoPoint(
              'EV1',
              const MarkerIcon(
                icon: Icon(
                  Icons.offline_bolt,
                  color: Colors.green,
                  size: 80,
                ),
              ),
              //Marker Cordinates List
              geopointlocation,
            ),
          ],
          androidHotReloadSupport: true,
          controller: controller,
          trackMyPosition: true,
          initZoom: 13,
          minZoomLevel: 2,
          maxZoomLevel: 19,
          stepZoom: 1.0,
          userLocationMarker: UserLocationMaker(
            personMarker: MarkerIcon(
              icon: Icon(
                Icons.radio_button_checked,
                color: Colors.blue,
                size: 80,
              ),
            ),
            directionArrowMarker: MarkerIcon(
              icon: Icon(
                Icons.radio_button_checked,
                color: Colors.blue,
                size: 80,
              ),
            ),
          ),
          markerOption: MarkerOption(
              defaultMarker: MarkerIcon(
            icon: Icon(
              Icons.person_pin_circle,
              color: Colors.blue,
              size: 56,
            ),
          )),
        ),`

Thank You.

liodali commented 9 months ago

yeah we put all those option in OSMOption that contain zoomOption and we removed androidHotReloadSupport and we replaced trackingMyPosition with UserTrackingOption? userTrackingOption you can take look at our maim example and aslo you can use userTrackingOption in mapController now