Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Update tileUrl not working #3611

Open
yonitou opened this issue Sep 3, 2024 · 3 comments
Open

[Bug]: Update tileUrl not working #3611

yonitou opened this issue Sep 3, 2024 · 3 comments
Labels
bug 🪲 Something isn't working

Comments

@yonitou
Copy link

yonitou commented Sep 3, 2024

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
Copy link
Author

yonitou commented Sep 9, 2024

Hi,

Is it possible to have an answer ?

@felixgourdeau
Copy link
Contributor

#2246

@yonitou
Copy link
Author

yonitou commented Sep 20, 2024

@felixgourdeau already did that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants