flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.04k stars 502 forks source link

Flutter Weather App #368

Closed mahmutcankurt closed 4 years ago

mahmutcankurt commented 4 years ago

I can't write Map's Class correctly, please help...

This Class doesn't work. How can I add my project this lib. Thanks..

(You can find my code on my repositories) -> https://github.com/mahmutcankurt1/FlutterWeatherApp

class SecondRoute extends StatelessWidget { @override Widget build(BuildContext context) { return new FlutterMap( options: new MapOptions( center: new LatLng(51.5, -0.09), zoom: 13.0, ), layers: [ new TileLayerOptions( urlTemplate: "https://api.mapbox.com/styles/v1/mahmutcankurt/ckckgily606gp2srzukfv1an3/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoibWFobXV0Y2Fua3VydCIsImEiOiJja2NrZ2lseTYwNmdwMnNyenVrZnYxYW4zIn0.KDcHWGT3kj16csFFJF5TiA", additionalOptions: { 'accessToken': 'pk.eyJ1IjoibWFobXV0Y2Fua3VydCIsImEiOiJja2NrZ2lseTYwNmdwMnNyenVrZnYxYW4zIn0.KDcHWGT3kj16csFFJF5TiA', 'id': 'mapbox.mapbox-streets-v7' }), new MarkerLayerOptions( markers: [ new Marker( width: 80.0, height: 80.0, point: new LatLng(51.5, -0.09), builder: (context) => new Container( child: RaisedButton( color: Colors.blue, onPressed: () { print('Marker tapped'); }, ), ), ), ], ), ], ); } }

m0nac0 commented 4 years ago

@mahmutcankurt1 Apparently you're using the flutter_map plugin. This is the repo for the mapbox_gl plugin though. If you want to switch to this plugin please check out the example app.