Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@amsterdam/arm-core

Package Overview
Dependencies
Maintainers
10
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@amsterdam/arm-core

Part of Amsterdam React Maps library.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
113
decreased by-7.38%
Maintainers
10
Weekly downloads
 
Created
Source

ARM Core

Part of Amsterdam React Maps library.

This is the link to the story book demo site with examples

Installation

Add this package to your project by running:

npm install --save @amsterdam/arm-core

Usage

import 'leaflet/dist/leaflet.css' // make sure this is always included!
import { Map, BaseLayer, GeoJSON, ViewerContainer, Zoom } from '@amsterdam/arm-core'

const json = {
    type: 'Feature',
    properties: {
      name: 'Amsterdam',
    },
    geometry: {
      type: 'Point',
      coordinates: [52, 4],
    },
  }

const MyComponent = () => (
  <Map fullScreen>
    <GeoJSON args={[json]} />
    <ViewerContainer bottomRight={<Zoom />} />
    <BaseLayer />
  </Map>
)

export default MyComponent

And when you want to use mapInstance in a different component:

...
import { useMapInstance } from '@amsterdam/arm-core';

const Search = () => (
    const mapInstance = useMapInstance();
    
    useEffect(() => {
      mapInstance.flyTo(x,y)
    }, [mapInstance])
)

export default Search

Exports components

  • Map: props options?, fullScreen?, setInstance?
  • BaseLayerToggle
  • ControlButton: extends Button
  • MapPanel
  • Scale: props options
  • ViewerContainer: props bottomLeft?, topLeft?, topRight?, bottomRight?
  • Marker: props latLng, options?, setInstance?
  • Zoom: props tabIndexIn?, tabIndexOut?

Exports leaflet layers

  • BaseLayer: props baseLayer?, options?, setInstance?
  • GeoJSON: props args, options?, setInstance?
  • GeoJSONLayer: props url, options, setInstance?
  • RDGeoJSON: props geometry, properties?, options?, setInstance?
  • WfsLayer: props url, options, zoomLevel, setInstance?

Exports hooks

  • useMapInstance()
  • useMapEvents(events?)
  • useEvents(instance, events?)
  • useGetAddressFromLatLng()
  • usePanToLatLng()
  • useStateRef()

Exports services

  • fetchWithAbort()
  • getBBox(mapInstance)
  • getCrsRd()

Exports constants

  • AMSTERDAM_LAYERS
  • AERIAL_AMSTERDAM_LAYERS
  • MIN_ZOOM_LEVEL
  • MAX_ZOOM_LEVEL
AMSTERDAM_MAPS_OPTIONS = {
  center: [52.3731081, 4.8932945],
  zoom: 10,
  maxZoom: 16,
  minZoom: 3,
  zoomControl: false,
  crs: getCrsRd(),
  maxBounds: [
    [52.25168, 4.64034],
    [52.50536, 5.10737],
  ],
}

FAQs

Package last updated on 27 Jun 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc