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

Marker offset

Open G0ldan opened this issue 2 years ago • 2 comments

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/[email protected]/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?

G0ldan avatar Oct 21 '22 14:10 G0ldan

have you tried changing iconAnchor: [25, 82] to iconAnchor: [50, 82] or iconAnchor: [0, 82]?

loloide avatar Feb 17 '23 20:02 loloide

Is there a way to remove the 'x' from the bubble?

Hajarat avatar Apr 23 '23 13:04 Hajarat