AndrewJBateman / angular-esri-arcgis

:clipboard: Displays map data from the ArcGIS API, using the esri-loader and an Angular map creation service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚑ Angular Esri Arcgis

  • Angular app to display a zoomable map view using the ArcGIS API mapping solution from Esri with esri-loader. Note: This is the old-fashioned way using esri-loader - from v4.18 of the ArcGIS API for JavaScript it is easier to use @arcgis/core and building with Esri ES modules instead of using esri-loader.

  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

πŸ“„ Table of contents

πŸ“š General info

  • ArcGIS API for Javascript CDN link in esri-map component.
  • ArcGIS for Developers offers a full suite of tools and resources to build mapping and analytics solutions. Use ArcGIS APIs to create location-based applications for web, desktop, and mobile devices.

πŸ“· Screenshots

Example screenshot

πŸ“Ά Technologies

πŸ’Ύ Setup

  • Install dependencies by running npm i
  • Run ng serve for a dev server. Navigate to http://localhost:4200/.
  • The app will automatically reload if you change any of the source files

πŸ”¦ Testing

  • No test code added.

πŸ’» Code Examples

  • extract from esri-map.component.ts to set up map coordinates etc.
export class EsriMapComponent implements OnInit {
  private _zoom = 10;
  private _center = [0.1246, 51.5007];
  private _basemap = 'streets';

  @Input()
  set zoom(zoom: number) {
    this._zoom = zoom;
  }

  get zoom(): number {
    return this._zoom;
  }

  @Input()
  set center(center: any[]) {
    console.log('centre: ', center);
    this._center = center;
  }

  get center(): any[] {
    return this._center;
  }

  @Input()
  set basemap(basemap: string) {
    this._basemap = basemap;
  }

  get basemap(): string {
    return this._basemap;
  }

  @Output() mapLoaded = new EventEmitter<boolean>();
  @ViewChild('mapView', { static: true }) public mapViewEl: ElementRef;

  constructor(private esriMapService: EsriMapService) {}

  public ngOnInit() {
    this.esriMapService
      .loadMap(this._basemap, this._center, this._zoom, this.mapViewEl)
      .then((res: Boolean) => {
        console.log('result of map loading: ', res);
        this.mapLoaded.emit(true);
      });
  }
}

πŸ†’ Features

  • map view pan function

πŸ“‹ Status & To-Do List

  • Status: Working.
  • To-Do: Nothing. This is the old way of accessing map data using esri-loader. In future use Esri ES modules.

πŸ‘ Inspiration

πŸ“ License

  • This project is licensed under the terms of the MIT license.

βœ‰οΈ Contact

  • Repo created by ABateman, email: gomezbateman@yahoo.com

About

:clipboard: Displays map data from the ArcGIS API, using the esri-loader and an Angular map creation service

License:MIT License


Languages

Language:TypeScript 72.9%Language:JavaScript 19.8%Language:HTML 4.6%Language:CSS 2.7%