You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have no problem with the first source and layer (casbaLayer and lineLayer)
and even with mapoCarto1
{
"type": "raster",
"url": "mapbox://esimioj.523ijr2w",
"tileSize": 256
}
but as soon as i set <Layer {...cartoLayer} />
something breaks!
mapbox-gl.js?0c80:31 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
at qc.url (mapbox-gl.js?0c80:31:248606)
at Me.loadTile (mapbox-gl.js?0c80:36:34855)
at ry._loadTile (mapbox-gl.js?0c80:32:124108)
at ry._addTile (mapbox-gl.js?0c80:32:132287)
at ry._updateRetainedTiles (mapbox-gl.js?0c80:32:130862)
at ry.update (mapbox-gl.js?0c80:32:129350)
at Jt._updateSources (mapbox-gl.js?0c80:36:127477)
at Map._render (mapbox-gl.js?0c80:36:468886)
at map._render (mapbox.js?699b:236:1)
at eval (mapbox-gl.js?0c80:36:476239)
I didn't find any example with raster layers, any help?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi there, it's my first post here!
I'm trying to display a new raster layer on top of my existing satellite map.
I've declared objs for source and layer
`const mapoCarto1 = {
type: "raster",
url: "mapbox://esimioj.523ijr2w",
tileSize: 256
};
const cartoLayer = {
id: "cartoLayer",
source: "mapoCarto1",
type: "raster",
//paint: { "raster-opacity": 1 },
};`
and I'm returning
` <Map
initialViewState={{
latitude: 44.1628,
longitude: 10.8609,
zoom: 12.5,
bearing: 270,
pitch: 78,
}}
maxPitch={85}
//mapStyle="mapbox://styles/mapbox/satellite-v9"
mapboxAccessToken={TOKEN}
interactiveLayerIds={["casbaLine"]}
terrain={{ source: "mapbox-dem", exaggeration: 1.0 }}
ref={mapRef}
onMouseMove={onHover}
>
...
I have no problem with the first source and layer (casbaLayer and lineLayer)
and even with mapoCarto1
{
"type": "raster",
"url": "mapbox://esimioj.523ijr2w",
"tileSize": 256
}
but as soon as i set <Layer {...cartoLayer} />
something breaks!
I didn't find any example with raster layers, any help?
Beta Was this translation helpful? Give feedback.
All reactions