Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Externalise the map interface methods to an angular service #892

Open
wants to merge 89 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
0fde8bb
feat: refactor mapgl, maplayer
MAudelGisaia Jul 31, 2024
6c05c62
fix: typo
MAudelGisaia Aug 23, 2024
f9955aa
feat: draw migration
MAudelGisaia Aug 30, 2024
241967b
fix: cleaning
MAudelGisaia Sep 9, 2024
33bc0e3
fix: implement fix from commit 8e8734f2
MAudelGisaia Sep 9, 2024
28f5bca
feat: replace mapbox map into other components
MAudelGisaia Sep 9, 2024
71f0d7d
feat: replace mapbox map into other components
MAudelGisaia Sep 9, 2024
d768d52
feat: replace mapbox map into other components
MAudelGisaia Sep 10, 2024
3497933
feat: add provider methode override
MAudelGisaia Sep 10, 2024
9f102e5
feat: add licence
MAudelGisaia Sep 10, 2024
fc120b2
feat: implement feedback
MAudelGisaia Sep 30, 2024
c891013
feat: change to any , export mapOverride
MAudelGisaia Sep 30, 2024
c6a2f8a
Rename to mapbox and remove uneeded methods
Oct 11, 2024
5ca3d3e
Resolve QMC comments
Oct 18, 2024
bb72f39
Fix lint
Oct 18, 2024
0ab5adc
Add missing licence
Oct 18, 2024
4e1d3c3
feat: add good export
MAudelGisaia Oct 18, 2024
3f1af64
feat: add maplibre classe
MAudelGisaia Oct 18, 2024
1bd9686
feat: add basmap mapplibre service
MAudelGisaia Oct 22, 2024
3f4cd5d
feat: refactor arlas draw
MAudelGisaia Oct 22, 2024
aa31141
feat: update of pmtiles
MAudelGisaia Oct 22, 2024
cfd7808
feat: add a demo for maplibre
MAudelGisaia Oct 22, 2024
21d045d
feat: fix maplibre class
MAudelGisaia Oct 22, 2024
cc65326
feat: add additional maplibre component
MAudelGisaia Oct 22, 2024
0d8a83a
feat: implement missing method
MAudelGisaia Oct 23, 2024
720f288
feat: add controlButton for malibre, fix double navigation control co…
MAudelGisaia Oct 24, 2024
1ed1757
feat: clean unused method from both implementation. Also remove last …
MAudelGisaia Oct 24, 2024
9262818
feat: fix wrong method
MAudelGisaia Oct 25, 2024
4e4bfab
feat: create maplibre comp for basemap and service
MAudelGisaia Oct 25, 2024
e4fc24c
feat: fix missing mapbox import in maplibre component
MAudelGisaia Oct 25, 2024
d3ab04d
feat: add logs
MAudelGisaia Oct 25, 2024
c28f164
feat: add maplibre legend component
MAudelGisaia Oct 28, 2024
75e79f3
feat: protomap load fixed for mapbox
MAudelGisaia Oct 28, 2024
7d4f51e
feat: protomap fixed for maplibre
MAudelGisaia Oct 28, 2024
97d9a60
Implement some todos of the mapbox/maplibre migration
MohamedHamouGisaia Oct 30, 2024
a2147d3
Merge pull request #875 from gisaia/feat/todos-map
MohamedHamouGisaia Oct 30, 2024
d0e8a73
Create map libs
MohamedHamouGisaia Oct 31, 2024
79124f2
Split mapbox/maplibre code in different librairies
MohamedHamouGisaia Oct 31, 2024
147b110
Maplibre lib
MohamedHamouGisaia Oct 31, 2024
4dd37f9
Build libs
MohamedHamouGisaia Nov 4, 2024
c153fe7
use one component
MohamedHamouGisaia Nov 5, 2024
06f7d9e
Use one map component
MohamedHamouGisaia Nov 6, 2024
de0097e
add legend
MohamedHamouGisaia Nov 8, 2024
3e7cbea
wip
MohamedHamouGisaia Nov 12, 2024
0e4e6a1
refactor legend
MohamedHamouGisaia Nov 14, 2024
14670de
Legends in mapbox + fix draw
MohamedHamouGisaia Nov 22, 2024
30f1c65
wip
MohamedHamouGisaia Nov 24, 2024
898fcea
maplibre
MohamedHamouGisaia Dec 4, 2024
a94ad08
Merge branch 'develop' into feat/merge_maplibre_angular15
MohamedHamouGisaia Dec 4, 2024
c74abf6
Define an interface to add/remove sources and layers to/from map
MohamedHamouGisaia Dec 9, 2024
34ce9fe
Externalise the map interface methods to an angular service
MohamedHamouGisaia Dec 10, 2024
64644f2
Externalise the map interface methods to an angular service
MohamedHamouGisaia Dec 12, 2024
fa5c93d
Fix linting
MohamedHamouGisaia Dec 12, 2024
9c0d553
Merge branch 'chore/angular18' into feat/refactor_map_interface
MohamedHamouGisaia Dec 13, 2024
57a7d01
Externalise draw features in a dedicated component
MohamedHamouGisaia Dec 16, 2024
66523d5
Fix build of libs and demo app
MohamedHamouGisaia Dec 16, 2024
2d0d504
Fix draw interface
MohamedHamouGisaia Dec 17, 2024
439b43d
Add documentation for map libraries
MohamedHamouGisaia Dec 17, 2024
5e7fede
Fix lint
MohamedHamouGisaia Dec 17, 2024
312b806
Merge branch 'chore/angular18' into feat/refactor_map_interface
MohamedHamouGisaia Dec 17, 2024
8667860
Fix lock file + vulnerability
MohamedHamouGisaia Dec 17, 2024
f9da476
Fix CI
MohamedHamouGisaia Dec 17, 2024
37f9c1c
Update packages
MohamedHamouGisaia Dec 17, 2024
fa5cc92
Move map texts translations to arlas-map library
MohamedHamouGisaia Dec 19, 2024
2df9664
Add ng test for all libraries
MohamedHamouGisaia Dec 19, 2024
edbdc63
Update README of each library
MohamedHamouGisaia Dec 19, 2024
72ae4e5
Use generic types for layers, sources and map options
MohamedHamouGisaia Dec 19, 2024
8bd8313
Remove index dead code
MohamedHamouGisaia Dec 19, 2024
11d3a3d
Fix typos and add error pipe for coordinates
MohamedHamouGisaia Dec 19, 2024
0b4f2c8
Fix more typos
MohamedHamouGisaia Dec 19, 2024
d496bf0
Merge branch 'develop' into feat/refactor_map_interface
MohamedHamouGisaia Dec 19, 2024
fe0c305
Add missing imports
MohamedHamouGisaia Dec 19, 2024
b085cf1
fix tests for ci
MohamedHamouGisaia Dec 20, 2024
2da4862
Fix tests + enhance sonarqube reliability score
MohamedHamouGisaia Dec 20, 2024
d2098b7
Fix CI
MohamedHamouGisaia Dec 20, 2024
c55e597
Fix reliability issues
MohamedHamouGisaia Dec 20, 2024
ade3027
Fix duplicated code
MohamedHamouGisaia Dec 20, 2024
688d8e5
Remove duplicated code
MohamedHamouGisaia Dec 20, 2024
af1f630
More reliability
MohamedHamouGisaia Dec 20, 2024
e077467
OnkeyDown to be more reliable :)
MohamedHamouGisaia Dec 20, 2024
a45776d
Reduce legend duplication
MohamedHamouGisaia Dec 20, 2024
6bc9d25
No Sonar for karma test
MohamedHamouGisaia Dec 20, 2024
e69b0b3
exclude files
MohamedHamouGisaia Dec 20, 2024
5bf9391
Reduce redundancy
MohamedHamouGisaia Dec 20, 2024
0d8bef2
Karma is real?
MohamedHamouGisaia Dec 20, 2024
8a6778c
Reduce legend duplication
MohamedHamouGisaia Dec 20, 2024
6c8693b
Maplibre is the new mapbox
MohamedHamouGisaia Dec 20, 2024
6d1d3dd
Rename vars in protocol code as it's touchy to refactor
MohamedHamouGisaia Dec 20, 2024
af45601
More refactor
MohamedHamouGisaia Dec 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ jobs:
run: npm run lint
- name: License check
run: npm run license-check
- name: Build
run: npm run build-release
- name: Build components
run: npm run build-components
- name: Build arlas-map
run: npm run build-map
- name: Build arlas-maplibre
run: npm run build-maplibre
- name: Build arlas-mapbox
run: npm run build-mapbox
- name: Test
run: npm run test
- name: Documentation
Expand Down
85 changes: 66 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,65 @@
# ARLAS web components :

[![Build Status](https://travis-ci.org/gisaia/ARLAS-web-components.svg?branch=develop)](https://travis-ci.org/gisaia/ARLAS-web-components)
[![npm version](https://badge.fury.io/js/arlas-web-components.svg)](https://badge.fury.io/js/arlas-web-components)

## About
# About this repo:

This repository contains 4 Angular libraries and one demo Angular application.

The 4 libraries are:
- **arlas-web-components**: contains a set of graphical component to explore data such as : donuts, histograms, powerbars, resultlits, metrics, metrics table,..
- **arlas-map**: contains one map component dedicated to display ARLAS data. This component is cartographical-framework-free. The libarary also comes with a number of services. Those services provide cartographical interfaces that should be implemented according to your chosen map framework.
- **arlas-maplibre**: this library provides a maplibregl implementation of the arlas-map library.
- **arlas-mapbox**: this library provides a maboxgl implementation of the arlas-map library.

> Note 1: **arlas-maplibre** and **arlas-mapbox** both have **arlas-map** as a dependency.

> Note 2: As a consequence, you can install **arlas-maplibre** or **arlas-mapbox** directly without the need of installing **arlas-map** precedently.


The demo application is composed of several tabs. Each tab provides an example of one component of **arlas-web-components** library or an implementation of **arlas-map** library.

ARLAS-web-components is an Angular library that provides a set of data analytics components.
## Artchitecture of **arlas-map**, **arlas-maplibre** and **arlas-mapbox**

## Install
<img src="./images/arlas-map-library.png">

To install this library in your npm Angular web app project add the dependency in your package.json :
- **arlas-map** provides the Angular components to be used in your apps.
- **arlas-map** components logic is declared in different services. Some are implemented when they don't depend directly on a cartographical framework. The rest are declared as abstract.
- The mapboxgl-js (v1.13) and maplibregl-js implementations are respectively coded in **arlas-mapbox** and **arlas-maplibre** libraries.



# Install

To install these libraries in your npm Angular web app project add the dependency in your package.json :

For arlas-web-components:
```shell
$ npm install --save arlas-web-components
```

## Documentation
For arlas-map:
```shell
$ npm install --save arlas-maplibre
```
Or
```shell
$ npm install --save arlas-mapbox
```

Please find the documentation of all the components [here](https://docs.arlas.io/classes/DonutComponent/).
# Build

## Build
## Prequesites:

To build the project you need to have installed
- [Node](https://nodejs.org/en/) version ^16.0.0
- [npm](https://github.com/npm/npm) version ^8.0.0
- [Angular CLI](https://github.com/angular/angular-cli) version ^14.2.13
To build the projects you need to have installed
- [Node](https://nodejs.org/en/) version ^18.19.1
- [npm](https://github.com/npm/npm) version ^10.0.0
- [Angular CLI](https://github.com/angular/angular-cli) version ^18.2.12
```
$ npm install -g @angular/cli@^14.2.13
$ npm install -g @angular/cli@^18.2.12
```
## Proceed to build

Then, clone the project
Clone the project

```shell
$ git clone https://github.com/gisaia/ARLAS-web-components
Expand All @@ -41,16 +71,33 @@ Move to the folder
$ cd ARLAS-web-components
```

Install all the project's dependencies
Install all the projects dependencies

```shell
$ npm install
```

Build the project with `ng` :

For arlas-web-components
```shell
$ npm run build-components
```

For arlas-map
```shell
$ npm run build-map
```

For arlas-maplibre
```shell
$ npm run build-maplibre
```


For arlas-mapbox
```shell
$ npm run build-release
$ npm run build-mapbox
```

The build artifacts will be generated in the `dist/` directory.
Expand Down Expand Up @@ -94,8 +141,8 @@ See also the list of [contributors](https://github.com/gisaia/ARLAS-web-componen

## License

This project is licensed under the Apache License, Version 2.0 - see the [LICENSE.txt](https://github.com/gisaia/ARLAS-web-components/blob/develop/LICENSE.txt) file for details.
These projects are licensed under the Apache License, Version 2.0 - see the [LICENSE.txt](https://github.com/gisaia/ARLAS-web-components/blob/develop/LICENSE.txt) file for details.

## Acknowledgments

This project has been initiated and is maintained by Gisaïa.
This repository has been initiated and is maintained by Gisaïa.
138 changes: 132 additions & 6 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"styles": [
"src/styles.css",
"node_modules/mapbox-gl/dist/mapbox-gl.css",
"node_modules/maplibre-gl/dist/maplibre-gl.css",
"node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css",
"node_modules/iv-viewer/dist/iv-viewer.css"
],
Expand Down Expand Up @@ -94,6 +95,7 @@
"styles": [
"src/styles.css",
"node_modules/mapbox-gl/dist/mapbox-gl.css",
"node_modules/maplibre-gl/dist/maplibre-gl.css",
"node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css",
"node_modules/iv-viewer/dist/iv-viewer.css"
],
Expand Down Expand Up @@ -153,11 +155,9 @@
"options": {
"main": "projects/arlas-components/src/test.ts",
"tsConfig": "projects/arlas-components/tsconfig.spec.json",
"karmaConfig": "projects/arlas-components/karma.conf.js",
"karmaConfig": "./karma.conf.js",
"styles": [
"src/styles.css",
"node_modules/mapbox-gl/dist/mapbox-gl.css",
"node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css",
"node_modules/iv-viewer/dist/iv-viewer.css"
]
}
Expand All @@ -167,9 +167,135 @@
"options": {
"eslintConfig": ".eslintrc.json",
"lintFilePatterns": [
"projects/**/*.spec.ts",
"projects/**/*.d.ts",
"projects/**/*.ts"
"projects/arlas-components/**/*.spec.ts",
"projects/arlas-components/**/*.d.ts",
"projects/arlas-components/**/*.ts"
]
}
}
}
},
"arlas-mapbox": {
"projectType": "library",
"root": "projects/arlas-mapbox",
"sourceRoot": "projects/arlas-mapbox/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/arlas-mapbox/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/arlas-mapbox/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/arlas-mapbox/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/arlas-mapbox/src/test.ts",
"tsConfig": "projects/arlas-mapbox/tsconfig.spec.json",
"karmaConfig": "./karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"eslintConfig": ".eslintrc.json",
"lintFilePatterns": [
"projects/arlas-mapbox/**/*.spec.ts",
"projects/arlas-mapbox/**/*.d.ts",
"projects/arlas-mapbox/**/*.ts"
]
}
}
}
},
"arlas-maplibre": {
"projectType": "library",
"root": "projects/arlas-maplibre",
"sourceRoot": "projects/arlas-maplibre/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/arlas-maplibre/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/arlas-maplibre/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/arlas-maplibre/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/arlas-maplibre/src/test.ts",
"tsConfig": "projects/arlas-maplibre/tsconfig.spec.json",
"karmaConfig": "./karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"eslintConfig": ".eslintrc.json",
"lintFilePatterns": [
"projects/arlas-maplibre/**/*.spec.ts",
"projects/arlas-maplibre/**/*.d.ts",
"projects/arlas-maplibre/**/*.ts"
]
}
}
}
},
"arlas-map": {
"projectType": "library",
"root": "projects/arlas-map",
"sourceRoot": "projects/arlas-map/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"project": "projects/arlas-map/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/arlas-map/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "projects/arlas-map/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/arlas-map/src/test.ts",
"tsConfig": "projects/arlas-map/tsconfig.spec.json",
"karmaConfig": "./karma.conf.js"
}
},
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"eslintConfig": ".eslintrc.json",
"lintFilePatterns": [
"projects/arlas-map/**/*.spec.ts",
"projects/arlas-map/**/*.d.ts",
"projects/arlas-map/**/*.ts"
]
}
}
Expand Down
Binary file added images/arlas-map-library.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 14 additions & 8 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
plugins,
client:{
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
fixWebpackSourcePaths: true
},
webpack: { node: { fs: 'empty', } },

reporters: ['progress', 'kjhtml'],
port: 9876,
Expand All @@ -27,6 +22,17 @@ module.exports = function (config) {
autoWatch: true,
browsers: ['ChromeHeadless'],
singleRun: true,
webpack: { node: { fs: 'empty', } }
});
};

const plugins = [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
]




Loading
Loading