Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

maplibre-gl-js-amplify

aws-amplify113.4kApache-2.04.0.2TypeScript support: included

MapLibre Plugin to Support Amplify Geo Integration

Amplify

readme

Maplibre GL JS Amplify

A plugin for maplibre-gl-js for integration with Amplify Geo.

Reporting Bugs/Feature Requests

Open Bugs Feature Requests Closed Issues

Usage

yarn add maplibre-gl-js-amplify

Using AmplifyMapLibreRequest to Display a Map

import { createMap } from "maplibre-gl-js-amplify";
import { Amplify } from "aws-amplify";
import awsconfig from './aws-exports';

Amplify.configure(awsconfig);
...
  const map = await createMap({
        container: "map", // An HTML Element or HTML element ID to render the map in https://maplibre.org/maplibre-gl-js-docs/api/map/
        center: [-123.1187, 49.2819],
        zoom: 11,
        region: "us-west-2"
  })

Using AmplifyGeocoderAPI with maplibre-gl-geocoder

import { Amplify } from "aws-amplify";
import { AmplifyGeocoderAPI } from "maplibre-gl-js-amplify";
import awsconfig from './aws-exports';
import maplibregl from "maplibre-gl";
import MaplibreGeocoder from "@maplibre/maplibre-gl-geocoder";
import "@maplibre/maplibre-gl-geocoder/dist/maplibre-gl-geocoder.css";

Amplify.configure(awsconfig);
...
  const geocoder = createAmplifyGeocoder();
  map.addControl(geocoder);

Using Custom Icon with drawPoints

import spiderManIcon from "./spiderman.svg"
...
const icon = new Image(100, 100);
icon.src = spiderManIcon;

map.on("load", function () {
  drawPoints(
    'mySourceName',
    [
      {
        coordinates: [-122.477, 37.8105],
      },
    ],
    map,
    {
      unclusteredOptions: {
        markerImageElement: icon,
      }
    }
  );
});

Deeper dive

API Documentation

See API.md for complete reference.

Examples

See FIXME.

Contributing

See CONTRIBUTING.md.

changelog

master

1.2.5

  • Temporarily disable autocomplete by default #116

Features / Improvements 🚀

  • Added getSuggestions API to AmplifyGeocoderAPI #106

Bug fixes 🐛

  • N/A

1.2.4

Features / Improvements 🚀

  • Added getSuggestions API to AmplifyGeocoderAPI #106

Bug fixes 🐛

1.2.3

Features / Improvements 🚀

  • Added amplify-map-.css for static map styles #98
  • Updated drawPoints to have an autoFit option to fit the map to points drawn #94

Bug fixes 🐛

1.2.1

  • Added AmplifyGeofenceControl #81

Features / Improvements 🚀

  • Added drawGeofences function #62
  • add setData, show, hide, utility functions to drawPoints return #70

1.1.3

Features / Improvements 🚀

  • Added drawGeofences function #62
  • add setData, show, hide, utility functions to drawPoints return #70

Bug fixes 🐛

1.1.2

Features / Improvements 🚀

Bug fixes 🐛

  • Update types for createAmplifyGeocoder #63
  • Add cjs modules #64

1.1.1

Features / Improvements 🚀

Bug fixes 🐛

  • Added error messaging when region is undefined #59
  • Fix cluster distances to match cluster circle size #56
  • Deselecting Point by Clicking outside map #54
  • update mouse pointer when mousing over marker layer #55
  • Allow popupRender to work properly #50

1.1.0

Features / Improvements 🚀

  • Updated drawPoints method to take new type NamedLocation data so that the title for each data point can be set #46

Bug fixes 🐛

1.0.7

Features / Improvements 🚀

Bug fixes 🐛

  • Fixed jest configuration for non JS files #40
  • Fixed geocoder svg to be generated by javascript #42
  • Removed default maplibre-gl-geocoder css import #43