Giter VIP home page Giter VIP logo

Comments (8)

vicapow avatar vicapow commented on May 13, 2024

mapStyle is expected to be an ImmutableJS object or a url string. Wrapping your style first in an ImmutableJS object with Immutable.fromJS(mapStyle) should resolve the issue.

from react-map-gl.

Jinnified avatar Jinnified commented on May 13, 2024

thank you for your help, the error is gone, however the tile layer is not rendering, i had a test static page using mapbox gl rendering the same tile layer which works fine, it;s something like this:

var map = new mapboxgl.Map({
        container: 'map',
        style: {
          "version": 8,
          "sources": {
            "raster-tiles": {
                "type": "raster",
                'tiles': [
                  'http://webrd02.is.xxx.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}'
                ],
                "tileSize": 256
            }
          },
          "layers": [{
              "id": "test",
              "type": "raster",
              "source": "raster-tiles",
              "minzoom": 0,
              "maxzoom": 22
          }]
        },
center: [120, 30], // starting position
        zoom: 9 // starting zoom
      })

so I was throwing the same 'style' object into the react-map-gl as i did in the original post with Immutable js around it, but the tile didn;t render at all and there is no error, did i miss something obvious?

I can see 200 for all my raster tiles over the network, and i assume they are all getting back fine, but it seems something is stopping it from show up in the canvas?

from react-map-gl.

Jinnified avatar Jinnified commented on May 13, 2024

the map just looks like a layer of light gray

from react-map-gl.

vicapow avatar vicapow commented on May 13, 2024

Can you post here the minimum code example that demonstrates the issue you're seeing?

from react-map-gl.

Jinnified avatar Jinnified commented on May 13, 2024

sorry, i made a stupid mistake, i didn't set the center and zoom correctly, as the map zoomed in very close in the middle of no where, so it looks like a gray screen, -__-!

from react-map-gl.

vicapow avatar vicapow commented on May 13, 2024

no worries. glad you figured it out!

from react-map-gl.

Jinnified avatar Jinnified commented on May 13, 2024

thanks again for your help, much appreciated :))

from react-map-gl.

kennetpostigo avatar kennetpostigo commented on May 13, 2024

@Jinnified I'm trying this out get that my container is undefined. How did you get around this from happening. The container is a div wrapping around the <DeckGL /> component with the id on the div set to mapboxcontainer

from react-map-gl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.