Skip to content

An example angular implementation of Ansyn component, which displays 2 imagery maps

Notifications You must be signed in to change notification settings

AnSyn/ansyn-impl-2win

Repository files navigation

Angular AnSyn Implementation

Installation

npm install @ansyn/ansyn @ansyn/assets

or

yarn add @ansyn/ansyn @ansyn/assets

(or, to update existing packages:)

yarn upgrade @ansyn/ansyn @ansyn/assets

Usage

add ansyn to your assets / styles on angular.json file, under yourProject/architect/build/options:

             "assets": [
                {
                  "glob": "**/*",
                  "input": "./node_modules/@ansyn/assets",
                  "output": "/assets"
                },
                {
                  "glob": "**/*",
                  "input": "node_modules/cesium/Build/Cesium",
                  "output": "/assets/Cesium"
                }
             ],
             "styles": [
               "node_modules/@ansyn/assets/styles/styles.css"
             ],
             "scripts": [
               "node_modules/cesium/Build/Cesium/Cesium.js"
             ]

on main.ts file:

import { fetchConfigProviders } from '@ansyn/ansyn';

fetchConfigProviders('assets/config/app.config.json').then(providers =>  platformBrowserDynamic(providers).bootstrapModule(AppModule).catch(err => console.log(err)));

on app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AnsynModule } from '@ansyn/ansyn';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AnsynModule.component()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

on app.component.html:

  ...
  <ansyn-app></ansyn-app>
  ...

AnsynApi service on ansyn.component.ts:

import { AnsynApi } from '@ansyn/ansyn';

@Component({
...
})
export class AppComponent {
  constructor(protected ansynApi: AnsynApi) {
  }
}

on app.component.css:

The element ansyn-app has to receive height. It can be explicit height, or implicit like "display:flex" + "flex:1" For example:

ansyn-app {
  display: block;
  height: 500px;
  border: 1px solid darkgreen;
}

About

An example angular implementation of Ansyn component, which displays 2 imagery maps

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •