maps icon indicating copy to clipboard operation
maps copied to clipboard

[Bug]: Update tileUrl not working

Open yonitou opened this issue 1 year ago • 3 comments

Mapbox Implementation

Mapbox

Mapbox Version

10.1.30

React Native Version

0.74

Platform

iOS, Android

@rnmapbox/maps version

10.1.30

Standalone component to reproduce

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>
	);
};

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

yonitou avatar Sep 03 '24 10:09 yonitou

Hi,

Is it possible to have an answer ?

yonitou avatar Sep 09 '24 10:09 yonitou

https://github.com/rnmapbox/maps/issues/2246

felixgourdeau avatar Sep 19 '24 14:09 felixgourdeau

@felixgourdeau already did that

yonitou avatar Sep 20 '24 09:09 yonitou