maplibre-react-native icon indicating copy to clipboard operation
maplibre-react-native copied to clipboard

Default `MapView` is not centered

Open KiwiKilian opened this issue 8 months ago • 1 comments

Describe and reproduce the Bug

On my Android Emulator the map is always off center initially when no Camera is given:

import {
  CircleLayer,
  MapView,
  ShapeSource,
} from "@maplibre/maplibre-react-native";

export function BugReport() {
  return (
    <MapView style={{ flex: 1 }}>
      <ShapeSource id="shape" shape={{ type: "Point", coordinates: [0, 0] }}>
        <CircleLayer
          id="circle"
          style={{ circleRadius: 8, circleColor: "red" }}
        />
      </ShapeSource>
    </MapView>
  );
}

Image Image

@maplibre/maplibre-react-native Version

main

Which platforms does this occur on?

Android Emulator

Which frameworks does this occur on?

React Native

Which architectures does this occur on?

Old Architecture

Environment

KiwiKilian avatar Mar 07 '25 20:03 KiwiKilian

@KiwiKilian From what I see, MLRN doesn't actually have default values for Camera.centerCoordinate or Camera.defaultSettings.centerCoordinate, meaning that the bug is in the native library. OTOH, maybe it makes sense for a downstream library like MLRN to have it's own defaults?

brentforder avatar Apr 04 '25 00:04 brentforder