All Projects → fegyi001 → Mangol

fegyi001 / Mangol

Maps created with Angular & OpenLayers using Material design

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Mangol

Simplenews.io
🏸 A news App,based on the RxJava 、MVP. 基于MVP、RxJava 、Android 组件化的新闻博客客户端.
Stars: ✭ 74 (-19.57%)
Mutual labels:  material
Togglebuttons
Android toggle buttons that adhere to the Material Design documentation.
Stars: ✭ 88 (-4.35%)
Mutual labels:  material
Iridium
Iridium is an extension built to improve your experience with the new YouTube Material layout
Stars: ✭ 1,298 (+1310.87%)
Mutual labels:  material
Flutter Music Player
Flutter Music Player - First Open Source Flutter based material design music player with audio plugin to play local music files.
Stars: ✭ 1,215 (+1220.65%)
Mutual labels:  material
Material Remixer
A set of cross-platform libraries and protocols to allow the sharing of design values and live refinement of apps during the development process.
Stars: ✭ 1,275 (+1285.87%)
Mutual labels:  material
Flat Remix Gnome
Flat Remix is a GNOME Shell theme inspired by material design. It is mostly flat using a colorful palette with some shadows, highlights, and gradients for some depth.
Stars: ✭ 1,291 (+1303.26%)
Mutual labels:  material
Schematics Utilities
🛠️ Useful exported utilities for working with Schematics
Stars: ✭ 73 (-20.65%)
Mutual labels:  material
Iconshowcase
Full-of-features, easy-to-customize, free and open source, Material Design dashboard for icon packs.
Stars: ✭ 91 (-1.09%)
Mutual labels:  material
Webclient Javascript
MapGIS Client for JavaScript, is a cloud GIS network client development platform. It makes a perfect fusion of traditional WebGIS and cloud GIS; also integrates four mainstream map open source frameworks and visualization libraries such as Echarts, MapV, and D3, etc.. Therefore, highly-efficient visual expression and analysis of big data and real-time streaming data have been further enhanced.
Stars: ✭ 88 (-4.35%)
Mutual labels:  openlayers
Colors App
🎨 A PWA for copying values from popular color palettes. Supports HEX, RGB, and HSL formats.
Stars: ✭ 90 (-2.17%)
Mutual labels:  material
Vue Mdc
Material web components for Vue.js
Stars: ✭ 1,217 (+1222.83%)
Mutual labels:  material
Material2 Carousel
A carousel component for Angular using Material
Stars: ✭ 84 (-8.7%)
Mutual labels:  material
Aybolit
Lightweight web components library built with LitElement.
Stars: ✭ 90 (-2.17%)
Mutual labels:  material
Nhentai Nhviewer
(NSFW) NHViewer is a simple third-party nhentai client for Android
Stars: ✭ 76 (-17.39%)
Mutual labels:  material
Material Design Icons
Material Design Icons
Stars: ✭ 90 (-2.17%)
Mutual labels:  material
Django Admin Material
A Django Admin interface based on Material Design by Google
Stars: ✭ 74 (-19.57%)
Mutual labels:  material
Gaugeslider
Highly customizable GaugeSlider designed for a Smart Home app. Featured at Medium.
Stars: ✭ 89 (-3.26%)
Mutual labels:  material
Core
Onscreen virtual keyboard for Angular ≥ 5 (https://angular.io/) using Angular Material (https://material.angular.io/).
Stars: ✭ 92 (+0%)
Mutual labels:  material
Godot Hair Shader
My attempt at a hair shader in Godot
Stars: ✭ 91 (-1.09%)
Mutual labels:  material
A File Icon Idea
Atom File Icons plugin for IntelliJ IDEA products
Stars: ✭ 90 (-2.17%)
Mutual labels:  material

Mangol

Maps created with Angular & OpenLayers using Material design

Join the chat at https://gitter.im/mangol_official/Lobby

Dependency Status devDependency Status

About Mangol

Mangol is an open source web mapping library for combining Angular, Angular Material and OpenLayers to create a modern, responsive interactive GUI for web maps (M stands for Material, ang for Angular and ol for OpenLayers). The project is written in TypeScript and uses SCSS for styling. Mangol uses @ngrx/store under the hood for state management.

Live example

An online example can be opened here.

Run demo & edit source files

If you wish to see the built-in demos or modify the source files, simply run ng serve or npm run start to load the demo page on localhost:4200. With this command you can also watch file changes until you shut it down.

Use as npm dependency

You most likely want to use Mangol as an npm library in your Angular (TypeScript & SCSS) project. You can also do that since Mangol is on npm as well.

First, add Mangol as a dependency to your project:

npm install --save mangol

or

yarn add mangol

You have to add to your app.module.ts (or whatever you call it in your project, the one that gets bootstrapped in main.ts)

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MangolModule } from 'mangol';

And in @NgModule add MangolModule and BrowserAnimationsModule to the imports:

imports: [
    ...,
    BrowserAnimationsModule,
    MangolModule,
    ...
]

Also add some vendor js files. If you use Webpack and created your project with @angular/cli, add the following libraries to your angular.json:

"scripts": [
    "node_modules/proj4/dist/proj4.js",
    "node_modules/jspdf/dist/jspdf.min.js"
]

At the beginning of your main SCSS file, you should import mangol.scss like this:

@import '~mangol/scss/mangol';

After that, you can use Mangol html tags in your templates such as

<mangol></mangol>

Run on localhost

At the moment when you run ng serve there will be the well-known error in the browser console: ExpressionChangedAfterItHasBeenCheckedError. Until this is fixed in Mangol please enable production mode in main.ts like this:

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';

enableProdMode();

platformBrowserDynamic()
  .bootstrapModule(AppModule)
  .catch(err => console.log(err));

Production build

Unfortunately there is a known issue with OL when build using Ahead-of-time (aot). To make aot possible, you should modify node_modules/ol/package.json file, and set "sideEffects": true. Another option is to disable optimization in your project config (in angular.json and set optimization: false, but I don't recommend it since the bundle size will be much bigger). After either of the above solutions, ng build --prod --aot should work fine.

Basic example

This is the simplest implementation of Mangol in a component (this will create a default map with one OpenStreetMap layer) :

import { Component } from '@angular/core';

@Component({
  selector: 'app',
  template: `
    <mangol></mangol>
  `
})
export class AppComponent {}

Configuring the component

You can further configure your Mangol component by creating a variable of type MangolConfig and add this property as an input for yor mangol component like this:

import { Component, OnInit } from '@angular/core';
import View from 'ol/View';
import { fromLonLat } from 'ol/proj.js';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
import { MangolConfig, MangolLayer } from 'mangol';

@Component({
  selector: 'app',
  template: `
     <mangol [config]="mangolConfig"></mangol>
  `
})
export class AppComponent implements OnInit {
  // Notice the MangolConfig type, this  is a helper interface to easily fill out the required and optional parameters for your Mangol configuration.
  mangolConfig = {} as MangolConfig;

  public ngOnInit() {
    this.mangolConfig = {
      map: {
        target: 'mangol-demo',
        view: new View({
          projection: 'EPSG:900913',
          center: fromLonLat(
            [19.3956393810065, 47.168464955013],
            'EPSG:900913'
          ),
          zoom: 4
        }),
        layers: [
          new MangolLayer({
            name: 'OpenStreetMap Layer',
            details: 'Here are the OSM layer details',
            layer: new TileLayer({
              source: new OSM(),
              visible: true
            })
          })
        ]
      },
      sidebar: {
        opened: true,
        toolbar: {
          layertree: {},
          measure: {}
        }
      }
    };
  }
}

Mangol is highly configurable through MangolConfig. Just check the API doc for further options (currently under heavy development).

Access and modify the internal State

After initialization you can also modify almost everything in your running Mangol app with a helper service called MangolService. Mangol is written in a reactive way which means almost every property is an RxJS Observable. Mangol itself uses @ngrx/store under the hood, and with the injectable MangolService you can access and modify the store state easily.

For example, if you wish to open the sidebar and change its title in runtime all you have to do is call the appropriate public functions form MangolService:

import { Component, OnInit } from '@angular/core';
import { MangolService, MangolConfig } from 'mangol';

@Component({
  selector: 'app-root',
  template: `
    <mangol [config]="mangolConfig"></mangol>
  `
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {

  config: MangolConfig;

  constructor(private mangolService: MangolService) {}

  ngOnInit() {
    // Initialize the MangolConfig with an empty and closed sidebar
    this.config = {
      sidebar: { title: 'Mangol Sidebar', collapsible: true, opened: true }
    };
    // After 1.5 seconds rename the sidebar title
    setTimeout(() => {
      this.mangolService.setSidebarTitle('My title modified after 1.5 sec');
    }, 1500);
    // After 3 seconds toggle the sidebar
    setTimeout(() => {
      this.mangolService.toggleSidebar();
      console.log('I just toggled the sidebar.');
    }, 3000);
  }
}

Styling

Mangol uses Material components and therefore it supports some SCSS customization. For example if you wish to alter the default colors, you can easily do that by overwriting the primary, accent and warn Material palettes before importing mangol.scss. Do it like this:

@import '[email protected]/material/theming';
@include mat-core();
$mangol-primary: mat-palette($mat-teal);
$mangol-accent: mat-palette($mat-lime);
$mangol-warn: mat-palette($mat-deep-orange);
$mangol-theme: mat-light-theme($mangol-primary, $mangol-accent, $mangol-warn);

@import '~mangol/scss/mangol';

If you wish to set the component height, sidebar width or the quicksearch panel width, also do it before importing mangol.scss:

$mangol-height: 400px;
$mangol-sidebar-width: 450px;
$mangol-quicksearch-width: 250px;

@import '~mangol/scss/mangol';

Author

Mangol was created by Gergely Padányi-Gulyás

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].