Open yonitou opened 2 months ago
Mapbox
10.1.30
0.74
iOS, Android
@rnmapbox/maps
import React, { useEffect, useState } from "react"; import { MapView, RasterLayer, RasterSource } from "@rnmapbox/maps"; const Component = () => { useEffect(() => { setInterval(() => { setCurrentWeather((prev) => prev >= prev + 1); }, 500); }, []); const [currentWeather, setCurrentWeather] = useState(0); return ( <MapView styleURL="mapbox://styles/mapbox/satellite-streets-v12"> <RasterSource id="stamen-watercolor" tileSize={256} tileUrlTemplates={[ `https://api.tomorrow.io/v4/map/tile/{z}/{x}/{y}/precipitationIntensity/${new Date(new Date().getTime() + currentWeather * 60 * 60 * 1000).toISOString()}.png?apikey=API_KEY` ]} /> <RasterLayer id="stamen-watercolor-layer" sourceID="stamen-watercolor" style={{ rasterOpacity: 0.85 }} /> </MapView> ); };
When updating the prop tileURLTemplate, nothing happens. I checked the documentation and I don't find how to update a layer or a source like in the MapboxGL package for JS.
tileURLTemplate
The layer should update when updating the url
No response
Hi,
Is it possible to have an answer ?
https://github.com/rnmapbox/maps/issues/2246
@felixgourdeau already did that
Mapbox Implementation
Mapbox
Mapbox Version
10.1.30
React Native Version
0.74
Platform
iOS, Android
@rnmapbox/maps
version10.1.30
Standalone component to reproduce
Observed behavior and steps to reproduce
When updating the prop
tileURLTemplate
, nothing happens. I checked the documentation and I don't find how to update a layer or a source like in the MapboxGL package for JS.Expected behavior
The layer should update when updating the url
Notes / preliminary analysis
No response
Additional links and references
No response