
Security News
AI Slop Is Polluting Bug Bounty Platforms with Fake Vulnerability Reports
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
react-leaflet-marker
Advanced tools
Custom markers for react-leaflet maps.
You can use any react component with version of react-leaflet 3.x.x || 4.x.x
npm i react-leaflet-marker --save
npm i react-leaflet-marker@1.1.4 --save
import React from "react";
import { MapContainer } from "react-leaflet";
import { MarkerLayer, Marker } from "react-leaflet-marker";
const ReactMarker = () => (
<MapContainer
{/* ...MapContainerProps react-leaflet */}
center={[55.796391, 49.108891]}
zoom={10}
>
<MarkerLayer>
<Marker
position={[55.796391, 49.108891]}
>
<div>Hi, i'm a react element</div>
</Marker>
</MarkerLayer>
</MapContainer>
);
export default ReactMarker;
Markers without size
can't take placement
props.
<MarkerLayer>
<Marker
position={[55.796391, 49.108891]}
>
<div style={{
background: 'red'
}}>
simple{'\u00A0'}marker
</div>
</Marker>
</MarkerLayer>
Just add size
props. It is the best practice the most cases.
<MarkerLayer>
<Marker
position={[55.796391, 49.108891]}
size={[80, 20]} // required for placement
// you can use optional `placement`
placement="center" // "top", "bottom"
>
<div style={{
background: 'red',
textAlign: 'center'
}}>
center
</div>
</Marker>
</MarkerLayer>
The marker will get on top of others when you hover the mouse over it.
<MarkerLayer>
<Marker
position={[55.796391, 49.108891]}
size={[80, 40]}
interactive // required for riseOnHover
riseOnHover
>
<div style={{
background: 'red',
textAlign: 'center'
}}>
First marker
</div>
</Marker>
</MarkerLayer>
For example, I used antd dropdown and custom icons
Name | Default | Type | Description |
---|---|---|---|
position | - | LatLngExpression | Lat Lng coordinates |
innerRef ? | - | MutableRefObject | |
riseOnHover ? | false | bool | If true , the marker will get on top of others when you hover the mouse over it.If true , the marker will get on top of others when you hover the mouse over it. |
riseOffset ? | 250 | number | The z-index offset used for the riseOnHover feature. |
zIndexOffset ? | 0 | number | By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like 1000 (or high negative value, respectively). |
interactive ? | false | bool | If set false , the marker won't respond to mouse |
size ? | - | [width: number, height: number] | Size marker. Required for placement |
placement ? | center | string | One of top , center , bottom |
FAQs
Custom markers for react-leaflet maps.
The npm package react-leaflet-marker receives a total of 891 weekly downloads. As such, react-leaflet-marker popularity was classified as not popular.
We found that react-leaflet-marker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.
Research
Security News
The Socket Research team investigates a malicious Python package disguised as a Discord error logger that executes remote commands and exfiltrates data via a covert C2 channel.
Research
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.