Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
101 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<ion-header> | ||
<ion-toolbar> | ||
<ion-title> | ||
Map Tab | ||
</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
|
||
<ion-content> | ||
<ion-card class="welcome-card"> | ||
<ion-img src="/assets/shapes.svg"></ion-img> | ||
<ion-card-header> | ||
<ion-card-title>Welcome to Ionic</ion-card-title> | ||
</ion-card-header> | ||
<ion-card-content> | ||
<p>This app shows how use Ionic with the ArcGIS API for JavaScript</p> | ||
</ion-card-content> | ||
</ion-card> | ||
|
||
<div id="map" #map ></div> | ||
</ion-content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Component, OnInit, ElementRef, ViewChild } from '@angular/core'; | ||
|
||
import { Platform } from '@ionic/angular'; | ||
|
||
import { loadModules } from 'esri-loader'; | ||
|
||
@Component({ | ||
selector: 'app-tab1', | ||
templateUrl: 'tab1.page.html', | ||
styleUrls: ['tab1.page.scss'] | ||
}) | ||
export class Tab1Page implements OnInit{ | ||
|
||
@ViewChild('map') mapEl: ElementRef; | ||
|
||
constructor( public platform: Platform) {} | ||
|
||
async getGeo() { | ||
|
||
// Reference: https://ionicframework.com/docs/api/platform/Platform/#ready | ||
await this.platform.ready(); | ||
|
||
// Load the ArcGIS API for JavaScript modules | ||
const [Map, MapView]:any = await loadModules([ | ||
'esri/Map', | ||
'esri/views/MapView' | ||
]) | ||
.catch(err => { | ||
console.error('ArcGIS: ', err); | ||
}); | ||
|
||
console.log('Starting up ArcGIS map'); | ||
|
||
let map = new Map({ | ||
basemap: 'hybrid' | ||
}); | ||
|
||
// Inflate and display the map | ||
let mapView = new MapView({ | ||
// create the map view at the DOM element in this component | ||
container: this.mapEl.nativeElement, | ||
center: [-12.287, -37.114], | ||
zoom: 12, | ||
map: map | ||
}); | ||
} | ||
|
||
ngOnInit() { | ||
this.getGeo(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.