Skip to content

Marker offset #25

@G0ldan

Description

@G0ldan

Hi, I am having a marker offset.

Targeting the Hôtel-Dieu of Paris, the popup is exactly where I want the blue marker to be.

Here is my code:

// App.js

import React from "react"
import { LeafletView } from "react-native-leaflet-view"

export default function App() {
  const [position] = React.useState({
    lat: 48.854665,
    lng: 2.34889,
  })

  return (
    <LeafletView
      mapCenterPosition={position}
      mapMarkers={[
        {
          position: position,
          title: "Hôtel-Dieu de Paris",
          icon: "https://unpkg.com/leaflet@1.9.2/dist/images/marker-icon-2x.png",
          size: [50, 82],
          iconAnchor: [25, 82],
        },
      ]}
    />
  )
}

Please note that the original picture size is 50x82, it is the reason why I put ... size: [50, 82], ... .

Please tell me what am I doing wrong?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions