Git Product home page Git Product logo

maplibre-gl-js-amplify's Introduction

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.

maplibre-gl-js-amplify's People

Contributors

0618 avatar amplifiyer avatar calebpollman avatar dependabot[bot] avatar eltociear avatar ioanabrooks avatar isaactrevino avatar lgtm-migrator avatar milan-shah avatar mojodna avatar nekoyasan avatar palpatim avatar reesscot avatar slaymance avatar sreeramsama avatar stocaaro avatar thaddmt avatar tretuna avatar wlee221 avatar zhamujun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.