Comments (8)
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.
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.
the map just looks like a layer of light gray
from react-map-gl.
Can you post here the minimum code example that demonstrates the issue you're seeing?
from react-map-gl.
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.
no worries. glad you figured it out!
from react-map-gl.
thanks again for your help, much appreciated :))
from react-map-gl.
@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)
- [Bug] Draw Polygon calls onClick for Map when drawing
- [Bug]Returning response json source not drawing Markers on map. HOT 2
- [Bug] geojson example is not redirecting to source
- Uncaught TypeError: Cannot read properties of null (reading 'point') HOT 4
- [Bug] Fog & marker issue - getOpacityAtLatLng HOT 2
- Canvas width/height don't update when container's width/height are changed HOT 5
- [Bug] Quickly double-clicking on maps prevents zooming in HOT 1
- Updating the accessToken doesn't update the API call and crash HOT 1
- [Bug] Can't set configuration property for map HOT 1
- [Bug] CORS Error on electron HOT 1
- [Feat] Custom map.querySourceFeatues Renderer HOT 2
- Support Maplibre GL JS 4.x HOT 2
- [Bug] missing advanced example for geocoder HOT 2
- [Bug] ssr support missing example to await for geocoder results HOT 3
- [Bug] incompatible dom objects within the react landscape HOT 4
- When setting maxZoom and dragging map around markers are moving all over the place [Bug] HOT 1
- [Bug] [docs] Link to MapLibre API docs are broken
- [Feat] Add support for latest Mapbox rendering release (V3) HOT 1
- [Bug] Input data given to 'xxx' is not a valid GeoJSON object
- [Bug] Map loading issue on resizing width HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-map-gl.