
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@openremote/or-map
Advanced tools
Web Component for displaying a Mapbox map; either raster or vector (default). This component requires an OpenRemote Manager to retrieve map settings and tiles.
npm i @openremote/or-map
yarn add @openremote/or-map
For a full list of properties, methods and options refer to the TypeDoc generated documentation.
<or-map center="5.454250, 51.445990" zoom="5" style="height: 500px; width: 100%;" />
For a raster map (raster tile serving in the OpenRemote Manager must be properly configured):
<or-map type="RASTER" center="5.454250, 51.445990" zoom="5" style="height: 500px; width: 100%;" />
The center and zoom are optional overrides for the defaults that will be defined in the mapsettings
loaded from the
OpenRemote Manager; each realm can have different mapsettings
with a fallback to the default.
Markers can be added via markup as children:
<or-map id="vectorMap" center="5.454250, 51.445990" zoom="5" style="height: 500px; width: 100%;">
<or-map-marker id="demo-marker" lng="5.454250" class="marker" icon="or:logo-plain"></or-map-marker>
</or-map>
Or programmatically:
const vectorMap = docuemnt.getElementById("vectorMap");
const assetMarker = document.createElement("or-map-marker-asset");
assetMarker.setAttribute("asset", apartment1.id!);
vectorMap.appendChild(assetMarker);
There are two types of built in markers:
This is a basic marker and the base class for any other markers and it has the following attributes:
or-icon
to render an icon inside the default marker)*required
The visual content of the marker can be controlled by adding child content to the or-map-marker
element; any child
content is rendered inside a div
. If no children are specified then the default marker will be used. Subclasses can
override the createMarkerContent()
method to control the look of the marker.
This links the marker to an Asset in the OpenRemote Manager by using the asset-mixin
and adds the following attribute:
*required
The Asset must be valid, accessible and must have a valid location
attribute otherwise no marker will be shown. By
default the AssetType
is used to set the icon of the marker but this can be controlled by setting the assetTypeAsIcon
property.
All styling is done through CSS, the following CSS variables can be used:
--or-map-marker-fill (default: #1D5632)
--or-map-marker-stroke (default: none)
--or-map-marker-width (default: 48px)
--or-map-marker-height (default: 48px)
--or-map-marker-transform (default: translate(-24px, -45px))
--or-map-marker-icon-fill (default: #FFF)
--or-map-marker-icon-stroke (default: none)
--or-map-marker-icon-width (default: 24px)
--or-map-marker-icon-height (default: 24px)
--or-map-marker-icon-transform (default: translate(-50%, -19px))
The following DOM events may be fired by the component and markers:
click
- Standard click event is fired when the map itself is clickedOrMapMarkerEvent.CLICKED
- A map marker has been clicked; details contains the clicked marker
OrMapMarkerEvent.CHANGED
- A map marker has been modified; details contains the changed marker
and name of changed
property
The last 2 versions of all modern browsers are supported, including Chrome, Safari, Opera, Firefox, Edge. In addition, Internet Explorer 11 is also supported.
FAQs
Displays s vector or raster map
The npm package @openremote/or-map receives a total of 227 weekly downloads. As such, @openremote/or-map popularity was classified as not popular.
We found that @openremote/or-map demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.