Skip to content

[web] MapboxMap accepts click and zoom events from overlay widgets #768

@SaeedMasoumi

Description

@SaeedMasoumi

Mapbox is not ignoring click/zoom events from overlay widgets. Also, the Mapbox logo is rendered on top of all widgets.

  <script src='https://api.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.js'></script>
  <link href='https://api.mapbox.com/mapbox-gl-js/v1.13.2/mapbox-gl.css' rel='stylesheet' />
void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Mapbox Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Stack(
      children: [
        MapboxMap(accessToken: accessToken, initialCameraPosition: kMontreal),
        Container(
          color: Colors.blue,
          width: 200,
          height: MediaQuery.of(context).size.height,
        ),
      ],
    ));
  }
}

mapbox_web

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions