Ahmed Eltabbal
Ahmed Eltabbal

Reputation: 51

Showing 3D globe view using flutter_map + Mapbox studio

I'm using flutter_map plugin with a MapBox style and I'm trying to display a 3D globe view in app

Globe

This is my current FlutterMap

FlutterMap(
                  mapController: controller,
                  options: MapOptions(
                    maxZoom: 19,
                    zoom: latestZoom,
                    center: userLocation ?? LatLng(lat, lon),
                  ),
                  children: [
                    TileLayer(
                      urlTemplate:   "https://api.mapbox.com/styles/v1/{username}/{mapStyleId}/tiles/256/{z}/{x}/{y}@2x?access_token={accessToken}",
                      additionalOptions: const {
                        'username': <username>,
                        'mapStyleId': <style.id>,
                        'accessToken': <access.token>,
                      },
                      maxZoom: 19,
                    ),

                      MarkerLayer(
                        markers: [
                          <markers>
                        ],
                      ),
                  ],
                ),

After some research I found out that the part responsible for the map view is the "crs" property in MapOptions and that the right projection and transform can give me the target result.

How can I find/create the right Crs class with the globe projection to be able to show a 3D globe view while maintaining the ability to display markers on it?

Upvotes: 3

Views: 2233

Answers (1)

Kaushik Makwana
Kaushik Makwana

Reputation: 2576

UPDATED 2024

you can use flutter_earth_globe

there is one more package flutter_earth using Tiles. in the 3D view, the only issue is that flutter_earth doesn't support a custom marker.

here is Link

https://pub.dev/packages/flutter_earth/versions

enter image description here

Upvotes: 0

Related Questions