npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@acpaas-ui/ngx-leaflet

v6.0.10

Published

This module renders a map component with some basic controls, based on [Leaflet](https://leafletjs.com).

Downloads

79

Readme

@acpaas-ui/ngx-leaflet

This module renders a map component with some basic controls, based on Leaflet.

Dependencies

  • leaflet
  • leaflet-draw
  • esri-leaflet

Usage

import { LeafletMap } from '@acpaas-ui/ngx-leaflet';

Add the leaflet CSS styles to the src/angular.json file.

"styles": [
    "node_modules/leaflet/dist/leaflet.css",
    "node_modules/leaflet-draw/dist/leaflet.draw.css"
]

Documentation

Visit our documentation site for full how-to docs and guidelines

Leaflet module

API

| Name | Default value | Description | | ---------------------------------- | ------------- | ----------------------------------------------------------------------------------------------- | | @Input() leafletMap: LeafletMap; | - | An instance of the Leaflet Map class. | | @Input() hasSidebar: boolean; | false | Define if the map has a sidebar. | | @Input() zoomLevel: number; | 19 | Define how far to zoom in Leaflet Zoom Level |

Check the Leaflet API reference for Leaflet specific API's.

Example

import { LeafletMap, baseMapWorldGray, baseMapAntwerp } from '@acpaas-ui/ngx-leaflet';

public leafletMap: LeafletMap = new LeafletMap({
    zoom: 13, // default zoom level
    center: [51.215, 4.425], // default center point
    onAddPolygon: (layer) => {},
    onAddLine: (layer) => {},
    onEditFeature: (feature) => {},
});

public ngOnInit(): void {
    this.leafletMap.onInit.subscribe(() => {
        this.leafletMap.addTileLayer(baseMapWorldGray);
        this.leafletMap.addTileLayer(baseMapAntwerp);
    });
}
<aui-leaflet [leafletMap]="leafletMap" [hasSidebar]="true">
  <div controls top left>
    <aui-leaflet-drag-control></aui-leaflet-drag-control>
    <aui-leaflet-draw-control></aui-leaflet-draw-control>
  </div>
  <div controls top right>
    <aui-leaflet-fullscreen-control></aui-leaflet-fullscreen-control>
  </div>
  <div controls bottom left>
    <aui-leaflet-locate-control zoomLevel="16"></aui-leaflet-locate-control>
  </div>
  <div controls bottom right>
    <aui-leaflet-zoom-control></aui-leaflet-zoom-control>
  </div>
  <div>Content displayed in sidebar</div>
</aui-leaflet>

Custom services

  • map: The native leaflet map instance
  • addTileLayer(layer: LeafletLayer): adds a tile layer to the map. (see leaflet docs)
  • addFeatureLayer(config: any): adds a feature layer to the map. (see esri leaflet docs)
  • addGeoJSON(geoJson: any, config: any): add geoJSON to the map. (see leaflet docs)
  • fitFeatureLayers(featureLayers): Fit the map bounds to the given feature layers.
  • removeLayer(layer): removes a layer
  • zoomIn(): Zoom in
  • zoomOut(): Zoom out
  • toggleFullscreen(): Toggle fullscreen
  • locate(zoomLevel): Start zooming to current location with an optional zoom level
  • setView(center, zoom): Zoom to the given center and zoom values.
  • addMarker(position, options): Adds a marker to the given position. (see leaflet docs)
  • addHTMLMarker: Adds an HTML marker to the given position.

Contributing

Visit our Contribution Guidelines for more information on how to contribute.