-
Notifications
You must be signed in to change notification settings - Fork 6
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Description
After updating to 1.0.0, I have noticed that the <GeolocateControl/>
causes an infinite effect loop.
Example with problem:
<MapLibre
onload={(e) => {...}}
{bounds}
{maxBounds}
{zoom}
{center}
renderWorldCopies={false}
onzoom={(e) => {...}}
onmovestart={(e) => {...}}
onmoveend={(e) => {...}}
onclick={(e) => {...}}
class="bg-background isolate h-full w-full"
attributionControl={false}
{style}
>
<NavigationControl position="top-left" visualizePitch />
<!-- THIS CAUSES INFINITE EFFECT LOOP -->
<GeolocateControl position="top-left" />
<ScaleControl position="bottom-left" />
<FullScreenControl position="top-left" />
{@render children?.()}
</MapLibre>
The error:
$effect(() => {
control && mapCtx.map?.removeControl(control);
control = new maplibregl.GeolocateControl(options);
mapCtx.map?.addControl(control, position);
});
If <GeolocateControl position="top-left" />
is removed, there is no problem.
ciscorn
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested