# ontimize-web-ng2-map

> An implementation of leaflet map for Ontimize Web

Latest version **2.0.0-rc.2** (published 2017-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ontimize-web-ng2-map
pnpm add ontimize-web-ng2-map
yarn add ontimize-web-ng2-map
bun add ontimize-web-ng2-map
```

## Health

**Score 40/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0-rc.2 |
| Published | 2017-09-20 |
| First published | 2016-10-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 2 |
| Author | IMATIA S.L. |
| Maintainers | daniel-grana, gonzalo-martinez-imt |
| Keywords | angular2, ontimize-web-ng2-map, map |

## Links

- npm: https://www.npmjs.com/package/ontimize-web-ng2-map
- Repository: https://github.com/OntimizeWeb/ontimize-web-ng2-map
- Homepage: https://github.com/OntimizeWeb/ontimize-web-ng2-map#readme
- Issues: https://github.com/OntimizeWeb/ontimize-web-ng2-map/issues
- npm.io page: https://npm.io/package/ontimize-web-ng2-map

## Dependencies (7)

- [dragula](https://npm.io/package/dragula.md) ^3.7.2
- [leaflet](https://npm.io/package/leaflet.md) 1.1.0
- [ng2-dragula](https://npm.io/package/ng2-dragula.md) 1.3.1
- [leaflet-draw](https://npm.io/package/leaflet-draw.md) 0.4.9
- [leaflet.heat](https://npm.io/package/leaflet.heat.md) 0.2.0
- [leaflet-providers](https://npm.io/package/leaflet-providers.md) 1.1.17
- [leaflet.markercluster](https://npm.io/package/leaflet.markercluster.md) 1.0.6

## Recent versions

- 2.0.0-rc.2 (latest) — 2017-09-20
- 2.0.0-rc.1 — 2017-09-01
- 2.0.0-rc.0 — 2017-08-07
- 1.0.2 — 2017-06-20
- 1.0.1 — 2017-04-18
- 1.0.0 — 2017-01-24
- 1.0.0-rc.0 — 2016-10-13

## README

# Ontimize Web Map
An implementation of leaflet map library for Ontimize Web.

* [Examples](#examples)
* [Installation](#installation)
* [Usage](#usage)

## Examples

Check out examples demo <a href="https://ontimizeweb.github.io/ontimize-web-ng2-map" target="_blank" title="examples demo">
here</a>

## Installation

First you need to install map module dependencies (leaflet and plugin libraries):
```sh
npm install leaflet@1.0.1 leaflet-providers@1.1.16 leaflet-draw@0.3.2 dragula@3.7.2 ng2-dragula@1.2.2-0 --save
```

Do not forget to add typings as well
```sh
typings install leaflet --ambient -DA
````

> Ensure that you have installed 'typings' node module globally with the same version of the one saved into the package.json of the
application.
For checking the version : typings -v
For installing globally: npm install -g typings@0.8.1

After that, install the npm map module:
```sh
npm install ontimize-web-ng2-map --save
```

## Usage

Finally, you can use ontimize-web-ng2-map in your Ontimize Web project.

### Configure third party dependencies and map module (Angular-cli & SystemeJS)

Configure third party dependencies like this:

**system-config.ts**
```sh
const cliSystemConfigPackages: any = {
};
// ontimize map module
cliSystemConfigPackages['ontimize-web-ng2-map'] = { main: 'o-map' };
// third party dependencies
cliSystemConfigPackages['leaflet'] = { main: 'dist/leaflet' };
cliSystemConfigPackages['leaflet-providers'] = { main: 'leaflet-providers', defaultExtension: 'js' };
cliSystemConfigPackages['leaflet-draw'] = { main: 'dist/leaflet.draw' };
cliSystemConfigPackages['ng2-dragula'] = { main: 'ng2-dragula', defaultExtension: 'js' };
cliSystemConfigPackages['dragula'] = { main: 'dragula', defaultExtension: 'js' };
cliSystemConfigPackages['contra'] = { main: 'contra', defaultExtension: 'js' };
cliSystemConfigPackages['atoa'] = { main: 'atoa', defaultExtension: 'js' };
cliSystemConfigPackages['ticky'] = { main: 'ticky', defaultExtension: 'js' };
cliSystemConfigPackages['crossvent'] = { main: 'crossvent', defaultExtension: 'js' };
cliSystemConfigPackages['custom-event'] = { main: 'index', defaultExtension: 'js' };

// Apply the CLI SystemJS configuration.
System.config({
  map: {
    ...

    'ontimize-web-ng2-map': 'vendor/ontimize-web-ng2-map',

    'leaflet': 'vendor/leaflet',
    'leaflet-providers': 'vendor/leaflet-providers',
    'leaflet-draw': 'vendor/leaflet-draw',
    'ng2-dragula': 'vendor/ng2-dragula',
    'dragula': 'vendor/dragula',
    'contra': 'vendor/contra',
    'atoa': 'vendor/atoa',
    'ticky': 'vendor/ticky',
    'crossvent': 'vendor/crossvent/src',
    'custom-event': 'vendor/custom-event'
    },
  packages: cliSystemConfigPackages
});

```

**angular-cli-build.js**
```sh
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');

module.exports = function(defaults) {
  return new Angular2App(defaults, {
    vendorNpmFiles: [
      ....

      'ontimize-web-ng2-map/*.js',
      'ontimize-web-ng2-map/src/**/*.js',

      'leaflet/**/*.js',
      'leaflet-providers/**/*.js',
      'leaflet-draw/**/*.js',
      'ng2-dragula/**/*.js',
      'dragula/*.js',
      'contra/*.js',
      'atoa/*.js',
      'ticky/*.js',
      'crossvent/src/*.js',
      'custom-event/*.js',

      'ontimize-web-ng2-map/**/*.css',
      'leaflet/**/*.css',
      'leaflet/dist/images/*.*',
      'leaflet-draw/**/*.css'
     ]
  });
};
```
**index.html**
Do not forget to include CSS style sheets

```sh
  <link rel="stylesheet" type="text/css" href="./vendor/leaflet/dist/leaflet.css">
  <link rel="stylesheet" type="text/css" href="./vendor/leaflet-draw/dist/leaflet.draw.css">
  <link rel="stylesheet" type="text/css" href="./vendor/ontimize-web-ng2-map/o-map.css">
```

**app.module.ts**
Include the library map module into your app.

```sh
...
import { OMapModule } from 'ontimize-web-ng2-map/o-map';
...

@NgModule({
  imports: [ ONTIMIZE_MODULES, routing, OMapModule],
  declarations: [
    AppComponent,
    ONTIMIZE_DIRECTIVES,
    ...APP_DIRECTIVES
  ],
  bootstrap: [ AppComponent ],
  providers: [
    ...standardProviders,
    ...customProviders
  ]
})
export class AppModule { }

```

---
_Source: https://npm.io/package/ontimize-web-ng2-map · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
