Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
react-leaflet-semicircle
Advanced tools
React wrapper of leaflet-semicircle for react-leaflet.
Semicircle vector layers for Leaflet maps. Extends L.Circle and L.CircleMarker.
Tested with Leaflet 1.4.0 and React-Leaflet 2.1.4
npm install react-leaflet-semicircle --save
import { Map, TileLayer } from 'react-leaflet';
import { SemiCircle, SemiCircleMarker } from 'react-leaflet-semicircle';
<Map center={[51.505, -0.09]} zoom={13}>
<TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
/>
<SemiCircle
position={[51.505, -0.09]}
radius={2000}
startAngle={90}
stopAngle={180}
/>
<SemiCircleMarker
position={[51.505, -0.09]}
radius={20}
startAngle={90}
stopAngle={180}
/>
</Map>;
<SemiCircle
position={[51.505, -0.09]}
radius={2000}
startAngle={90}
stopAngle={180}
/>
Name | Type | Example | Description |
---|---|---|---|
position [required] | L.LatLng[] or Array[number, number] | [51.505, -0.09] | Latitude and Longitude of the semicircle center |
radius [required] | number | 2000 | Radius of the semicircle in metres |
startAngle | number | 90 | Starting bearing of the semicircle |
stopAngle | number | 180 | Ending bearing of the semicircle |
All other options from L.Circle are also supported. View them here
<SemiCircleMarker
position={[51.505, -0.09]}
startAngle={90}
stopAngle={180}
/>
Name | Type | Example | Description |
---|---|---|---|
position [required] | L.LatLng[] or Array[number, number] | [51.505, -0.09] | Latitude and Longitude of the semicirclemarker center |
startAngle | number | 90 | Starting bearing of the semicirclemarker |
stopAngle | number | 180 | Ending bearing of the semicirclemarker |
All other options from L.CircleMarker are also supported. View them here
Each component comes with methods that can be accessed via React Refs.
this.semiCircleRef = React.createRef();
----
<SemiCircle
position={[51.505, -0.09]}
radius={2000}
startAngle={90}
stopAngle={180}
ref={this.semiCircleRef}
/>
Use setDirection(direction, size)
to display a semicircle of size
degrees at direction
.
this.semiCircleRef.current.setDirection(90, 90);
Set the start angle of the semicircle to angle
this.semiCircleRef.current.setStartAngle(90);
Set the stop angle of the semicircle to angle
this.semiCircleRef.current.setStopAngle(90);
FAQs
React wrapper of leaflet-semicircle
The npm package react-leaflet-semicircle receives a total of 62 weekly downloads. As such, react-leaflet-semicircle popularity was classified as not popular.
We found that react-leaflet-semicircle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.