Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it gives me blank... no map is showing.... i tried a lot of tutorials ...so tired and depressed #206

Closed
Muhammad-saafan opened this issue Jan 14, 2019 · 14 comments

Comments

@Muhammad-saafan
Copy link

Muhammad-saafan commented Jan 14, 2019

layers: [
new TileLayerOptions(
urlTemplate:
// "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
// subdomains: ['a', 'b', 'c']),
"https://api.mapbox.com/styles/v1/muhammad94/cjqwfwdpr1o452sqzoy3b74ua.html?fresh=true&title=true&access_token=pk.eyJ1IjoibXVoYW1tYWQ5NCIsImEiOiJjanF3N3o2ZzUwb2R1NDJudzJnY3VkMXcxIn0.jo3ONUsCTUYRv7YAZrehlQ#9.0/37.780000/-122.424100/0",
additionalOptions: {
'accessToken':
'<pk.eyJ1IjoibXVoYW1tYWQ5NCIsImEiOiJjanF3N3o2ZzUwb2R1NDJudzJnY3VkMXcxIn0.jo3ONUsCTUYRv7YAZrehlQ>',
'id': 'mapbox.mapbox-streets-v8',
},
this is my code when using leaflet it works and when using mapbox it give me blank page

@Muhammad-saafan Muhammad-saafan changed the title it gives me blank... no map is showing i tried a lot of tutorials so tired and depressed it gives me blank... no map is showing.... i tried a lot of tutorials ...so tired and depressed Jan 14, 2019
@Muhammad-saafan
Copy link
Author

this is the console
Launching lib\main.dart on SM N910C in debug mode...

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
Built build\app\outputs\apk\debug\app-debug.apk.
I/Timeline(24477): Timeline: Activity_idle id: android.os.BinderProxy@46ad9a7 time:143657055
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 0
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 1
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 0
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 1
E/flutter (24477): [ERROR:flutter/lib/ui/painting/codec.cc(97)] Failed decoding image. Data is either invalid, or it is encoded using an unsupported format.
I/flutter (24477): ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
I/flutter (24477): The following _Exception was thrown resolving an image codec:
I/flutter (24477): Exception: operation failed
I/flutter (24477): When the exception was thrown, this was the stack:
I/flutter (24477): #0 NetworkImage._loadAsync (package:flutter/src/painting/image_provider.dart:498:12)
I/flutter (24477):
I/flutter (24477): #1 NetworkImage.load (package:flutter/src/painting/image_provider.dart:471:14)
I/flutter (24477): #2 ImageProvider.resolve.. (package:flutter/src/painting/image_provider.dart:267:86)
I/flutter (24477): #3 ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:143:20)
I/flutter (24477): #4 ImageProvider.resolve. (package:flutter/src/painting/image_provider.dart:267:63)
I/flutter (24477): #5 SynchronousFuture.then (package:flutter/src/foundation/synchronous_future.dart:38:29)
I/flutter (24477): #6 ImageProvider.resolve (package:flutter/src/painting/image_provider.dart:265:30)
I/flutter (24477): #7 _ImageProviderResolver.resolve (package:flutter/src/widgets/fade_in_image.dart:333:29)
I/flutter (24477): #8 _FadeInImageState._resolveImage (package:flutter/src/widgets/fade_in_image.dart:408:20)
I/flutter (24477): #9 _FadeInImageState.didChangeDependencies (package:flutter/src/widgets/fade_in_image.dart:390:5)
I/flutter (24477): #10 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3846:12)
I/flutter (24477): #11 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #12 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #13 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #14 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (24477): #15 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (24477): #16 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (24477): #17 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #18 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #19 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #20 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (24477): #21 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (24477): #22 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (24477): #23 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #24 ParentDataElement.mount (package:flutter/src/widgets/framework.dart:4047:11)
I/flutter (24477): #25 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #26 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4965:32)
I/flutter (24477): #27 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #28 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #29 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (24477): #30 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #31 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #32 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (24477): #33 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (24477): #34 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (24477): #35 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #36 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #37 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #38 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (24477): #39 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (24477): #40 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (24477): #41 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (24477): #42 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #43 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #44 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4965:32)
I/flutter (24477): #45 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #46 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #47 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (24477): #48 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (24477): #49 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (24477): #50 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #51 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #52 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #53 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (24477): #54 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #55 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #56 SingleChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:4860:14)
I/flutter (24477): #57 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #58 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #59 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (24477): #60 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (24477): #61 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (24477): #62 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3848:11)
I/flutter (24477): #63 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #64 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #65 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #66 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3732:16)
I/flutter (24477): #67 Element.rebuild (package:flutter/src/widgets/framework.dart:3547:5)
I/flutter (24477): #68 ComponentElement._firstBuild (package:flutter/src/widgets/framework.dart:3701:5)
I/flutter (24477): #69 ComponentElement.mount (package:flutter/src/widgets/framework.dart:3696:5)
I/flutter (24477): #70 Element.inflateWidget (package:flutter/src/widgets/framework.dart:2950:14)
I/flutter (24477): #71 Element.updateChild (package:flutter/src/widgets/framework.dart:2753:12)
I/flutter (24477): #72 _LayoutBuilderElement._layout. (package:flutter/src/widgets/layout_builder.dart:118:18)
I/flutter (24477): #73 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2266:19)
I/flutter (24477): #74 _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:107:11)
I/flutter (24477): #75 RenderObject.invokeLayoutCallback. (package:flutter/src/rendering/object.dart:1730:58)
I/flutter (24477): #76 PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:799:15)
I/flutter (24477): #77 RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1730:13)
I/flutter (24477): #78 _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:205:5)
I/flutter (24477): #79 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #80 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11)
I/flutter (24477): #81 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:339:7)
I/flutter (24477): #82 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7)
I/flutter (24477): #83 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14)
I/flutter (24477): #84 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #85 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #86 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #87 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #88 _RenderCustomClip.performLayout (package:flutter/src/rendering/proxy_box.dart:1188:11)
I/flutter (24477): #89 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #90 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #91 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #92 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #93 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #94 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #95 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #96 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #97 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #98 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #99 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #100 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #101 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #102 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:13)
I/flutter (24477): #103 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #104 RenderOffstage.performLayout (package:flutter/src/rendering/proxy_box.dart:2879:14)
I/flutter (24477): #105 RenderObject.layout (package:flutter/src/rendering/object.dart:1634:7)
I/flutter (24477): #106 RenderStack.performLayout (package:flutter/src/rendering/stack.dart:510:15)
I/flutter (24477): #107 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1509:7)
I/flutter (24477): #108 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:768:18)
I/flutter (24477): #109 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:281:19)
I/flutter (24477): #110 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:677:13)
I/flutter (24477): #111 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:219:5)
I/flutter (24477): #112 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
I/flutter (24477): #113 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
I/flutter (24477): #114 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
I/flutter (24477): #115 _invoke (dart:ui/hooks.dart:154:13)
I/flutter (24477): #116 _drawFrame (dart:ui/hooks.dart:143:3)
I/flutter (24477): Image provider:
I/flutter (24477): NetworkImage("https://api.mapbox.com/styles/v1/muhammad94/cjqwfwdpr1o452sqzoy3b74ua.html?fresh=true&title=true&access_token=pk.eyJ1IjoibXVoYW1tYWQ5NCIsImEiOiJjanF3N3o2ZzUwb2R1NDJudzJnY3VkMXcxIn0.jo3ONUsCTUYRv7YAZrehlQ#9.0/37.780000/-122.424100/0",
I/flutter (24477): scale: 1.0)
I/flutter (24477): Image key:
I/flutter (24477): NetworkImage("https://api.mapbox.com/styles/v1/muhammad94/cjqwfwdpr1o452sqzoy3b74ua.html?fresh=true&title=true&access_token=pk.eyJ1IjoibXVoYW1tYWQ5NCIsImEiOiJjanF3N3o2ZzUwb2R1NDJudzJnY3VkMXcxIn0.jo3ONUsCTUYRv7YAZrehlQ#9.0/37.780000/-122.424100/0",
I/flutter (24477): scale: 1.0)
I/flutter (24477): ════════════════════════════════════════════════════════════════════════════════════════════════════
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 0
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 1
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 0
D/ViewRootImpl(24477): ViewPostImeInputStage processPointer 1
V/ActivityThread(24477): updateVisibility : ActivityRecord{f616943 token=android.os.BinderProxy@46ad9a7 {com.example.hazzam/com.example.hazzam.MainActivity}} show : true

@ibrierley
Copy link
Collaborator

ibrierley commented Jan 14, 2019

Bit confused, haven't you just commented out the URL for the tiles & subdomain and included an interactive webpage that wouldn't work (I can't tell properly from where I am), but you would need to include a tile serving URL ?
What happens if you use the original URL and subdomain ?

@cetorres
Copy link

cetorres commented Jan 16, 2019

@Muhammad-saafan you have to use the correct URL on the urlTemplate like this:

layers: [
new TileLayerOptions(
urlTemplate: "https://api.mapbox.com/v4/{id}/{z}/{x}/{y}@2x.png?access_token={accessToken}",
additionalOptions: {
    'accessToken': '<your-key>',
    'id': 'mapbox.streets'
})]

@stafyniaksacha
Copy link

layers: [
  new TileLayerOptions(
    urlTemplate: "https://api.mapbox.com/styles/v1/{id}/tiles/512/{z}/{x}/{y}@2x?access_token={accessToken}",
    additionalOptions: {
      'accessToken': 'pk.eyJ1IjoibXVoYW1tYWQ5NCIsImEiOiJjanF3N3o2ZzUwb2R1NDJudzJnY3VkMXcxIn0.jo3ONUsCTUYRv7YAZrehlQ',
      'id': 'mapbox.mapbox-streets-v8',
    },
  ),

this will work well, i took time to find good uri which work with leaflet too
notice that i removed < & > from your token, it will work now

@johnpryan
Copy link
Collaborator

@stafyniaksacha thanks for helping out. @Muhammad-saafan did this fix your issue? It sounds like we need to add a better explanation for additionalOptions?

@thanooshan
Copy link

Same issue, any solutions?

@johnpryan
Copy link
Collaborator

@thanooshan is your url template correct?

@thanooshan
Copy link

thanooshan commented Mar 15, 2019

layers: [ new TileLayerOptions( urlTemplate: "https://api.mapbox.com/styles/v1/thanooshan/{somekey}/wmts?access_token="{accessToken}", additionalOptions: { 'accessToken': '{accessToken}', 'id': 'mapbox.mapbox-streets-v8', }, ) ]

@johnpryan This is my layers code. Am I missing something?

@thanooshan
Copy link

@johnpryan @stafyniaksacha Map is working.
Screen Shot 2019-03-24 at 10 20 29 AM

We have to use CARTO url. Previously I used WMTS url.

@ollyde
Copy link

ollyde commented May 5, 2019

For anyone else stuck I found a url that works

Here an example:

Replace my username acidhue and the key after it with your own.

https://api.mapbox.com/styles/v1/acidhue/cjvb13pgd12t01flpd97ub8dx/tiles/256/{z}/{x}/{y}@2x?access_token=$mapboxKey

@johnpryan
Copy link
Collaborator

thanks @OllyDixon!

@cosmotek
Copy link

Fixed by getting a url from Mapbox studio > Share button > Third party tab > CARTO option in dropdown with the following code:

          Container(
            width: 500,
            height: 500,
            child: FlutterMap(
              options: MapOptions(
                center: LatLng(51.5, -0.09),
                zoom: 13.0,
              ),
              layers: [
                TileLayerOptions(
                  urlTemplate: "https://api.mapbox.com/styles/v1/<username>/ck15ozlow33tj1cph5cpt2y79/tiles/256/{z}/{x}/{y}@2x?access_token=<token>",
                ),
                MarkerLayerOptions(
                  markers: [
                    Marker(
                      width: 80.0,
                      height: 80.0,
                      point: LatLng(51.5, -0.09),
                      builder: (ctx) =>
                      Container(
                        child: FlutterLogo(),
                      ),
                    ),
                  ],
                ),
              ],
            ),
          ),

There are a few parts here that I would really love to see reflected in the docs for this plugin. First off, I had to figure out to use a container to size things, secondly, the URL and how to get it...

@Mehrbod2002
Copy link

hello i have same issue and try lot with codes which users here recommended . also with Mapbox studio i use this code but still receive null gray page

import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:latlong/latlong.dart';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new MaterialApp(
      home: new MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => new _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
        appBar: new AppBar(title: new Text('Leaflet Maps')),
        body: new FlutterMap(
            options: new MapOptions(
                center: new LatLng(35.22, -101.83), minZoom: 5.0),
            layers: [
              new TileLayerOptions(
                  urlTemplate:
                      "https://api.mapbox.com/styles/v1/rajayogan/cjl1bndoi2na42sp2pfh2483p/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoicmFqYXlvZ2FuIiwiYSI6ImNqNW1nOXhtMTNndXkyeG5xbDZiNzZmaGcifQ.S5sdpVrOr2pa5oRqvWDMGA",
                  additionalOptions: {
                    'accessToken':
                        'pk.eyJ1IjoicmFqYXlvZ2FuIiwiYSI6ImNqNW1nOXhtMTNndXkyeG5xbDZiNzZmaGcifQ.S5sdpVrOr2pa5oRqvWDMGA',
                    'id': 'mapbox.mapbox-streets-v7'
                  }),
              new MarkerLayerOptions(markers: [
                new Marker(
                    width: 45.0,
                    height: 45.0,
                    point: new LatLng(35.215, -101.825),
                    builder: (context) => new Container(
                          child: IconButton(
                            icon: Icon(Icons.location_on),
                            color: Colors.blue,
                            iconSize: 45.0,
                            onPressed: () {
                              print('Marker tapped');
                            },
                          ),
                        ))
              ])
            ]));
  }
}```

@ibrierley
Copy link
Collaborator

Not sure if that's the correct token, but it says invalid token...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants