Skip to content

Commit

Permalink
Merge 74645ef into 1da9f2e
Browse files Browse the repository at this point in the history
  • Loading branch information
atd-schubert committed Feb 12, 2018
2 parents 1da9f2e + 74645ef commit b0f21ca
Show file tree
Hide file tree
Showing 7 changed files with 291 additions and 13 deletions.
6 changes: 6 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ <h4>Icons</h4>
<li class="list-group-item"><a href="./div-icon-directive">Div-Icon-Directive</a></li>
</ul>

<h4>Modals</h4>
<ul class="list-group">
<li class="list-group-item"><a href="./popup-directive">Popup-Directive</a></li>
<li class="list-group-item"><a href="./tooltip-directive">Tooltip-Directive</a></li>
</ul>

<h4>Controls</h4>
<ul class="list-group">
<li class="list-group-item"><a href="./attribution-control-directive">Attribution-Control-Directive</a></li>
Expand Down
20 changes: 20 additions & 0 deletions examples/popup-directive/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>YAGA | leaflet-ng2 | Popup-Directive Example</title>
<script src="bundle.js"></script>
<link rel="stylesheet" href="../../node_modules/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="../../node_modules/bootstrap/dist/css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="../../node_modules/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="../../node_modules/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="../default.css" />
<style>
</style>
</head>
<body>
<app></app>

</body>
</html>
106 changes: 106 additions & 0 deletions examples/popup-directive/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
// Shims
import 'reflect-metadata';
import 'zone.js';

import { YagaModule } from '../../lib/index'; // @yaga/leflet-ng2

import { Component, PlatformRef } from '@angular/core';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { Point, LatLng } from 'leaflet';

import { ExampleAppComponentBlueprint, IExampleProperties } from '../app-component-blueprint';
import { ExamplePropertiesModule, PROPERTIES_WRAPPER } from '../property.component';

const platform: PlatformRef = platformBrowserDynamic();

/* tslint:disable:max-line-length */
const template: string = `
<example-header [title]="'Popup-Directive'"></example-header>
<div class="container">
<div class="map">
<yaga-map>
<yaga-marker>
<yaga-popup
[(opened)]="getDuplexPropertyByName('opened').value"
(open)="handleEvent('open', $event)"
(close)="handleEvent('close', $event)"
[maxWidth]="getInputPropertyByName('maxWidth').value"
[minWidth]="getInputPropertyByName('minWidth').value"
[maxHeight]="getInputPropertyByName('maxHeight').value"
[autoPan]="getInputPropertyByName('autoPan').value"
[autoPanPaddingTopLeft]="getInputPropertyByName('autoPanPaddingTopLeft').value"
[autoPanPaddingBottomRight]="getInputPropertyByName('autoPanPaddingBottomRight').value"
[autoPanPadding]="getInputPropertyByName('autoPanPadding').value"
[keepInView]="getInputPropertyByName('keepInView').value"
[closeButton]="getInputPropertyByName('closeButton').value"
[autoClose]="getInputPropertyByName('autoClose').value"
[className]="getInputPropertyByName('className').value"
>
{{ getDuplexPropertyByName('content').value }}
<!--
It would also be possible to pass the content with:
[(content)]="getDuplexPropertyByName('content').value"
-->
</yaga-popup>
</yaga-marker>
<yaga-tile-layer [url]="'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png'"></yaga-tile-layer>
</yaga-map>
</div>
${ PROPERTIES_WRAPPER }
</div><!-- /.container -->
<example-footer></example-footer>
`;
/* tslint:enable */

/* tslint:disable:max-classes-per-file */
@Component({
selector: 'app',
template,
})
export class AppComponent extends ExampleAppComponentBlueprint {
public properties: IExampleProperties = {
duplex: [
{name: 'content', value: 'Some example content...', type: 'text' },
{name: 'opened', value: false, type: 'checkbox' },
// {name: 'lat', value: 51, type: 'number' },
// {name: 'lng', value: 7, type: 'number' },
// {name: 'position', value: new LatLng(51, 7), type: 'latlng' },
],
input: [
{name: 'maxWidth', value: 300, type: 'number' },
{name: 'minWidth', value: 100, type: 'number' },
{name: 'maxHeight', value: 300, type: 'number' },
{name: 'autoPan', value: true, type: 'checkbox' },
{name: 'autoPanPaddingTopLeft', value: true, type: 'checkbox' },
{name: 'autoPanPaddingBottomRight', value: true, type: 'checkbox' },
{name: 'autoPanPadding', value: true, type: 'checkbox' },
{name: 'keepInView', value: true, type: 'checkbox' },
{name: 'closeButton', value: true, type: 'checkbox' },
{name: 'autoClose', value: true, type: 'checkbox' },
{name: 'className', value: 'example-css-class', type: 'text' },
{name: 'pane', value: 'popup', type: 'text' },
],
output: [
{name: 'open', value: '', type: 'event' },
{name: 'close', value: '', type: 'event' },
],
};
}

@NgModule({
bootstrap: [ AppComponent ],
declarations: [ AppComponent ],
imports: [ BrowserModule, FormsModule, YagaModule, ExamplePropertiesModule ],
})
export class AppModule { }

document.addEventListener('DOMContentLoaded', () => {
platform.bootstrapModule(AppModule);
});
20 changes: 20 additions & 0 deletions examples/tooltip-directive/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>YAGA | leaflet-ng2 | Tooltip-Directive Example</title>
<script src="bundle.js"></script>
<link rel="stylesheet" href="../../node_modules/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="../../node_modules/bootstrap/dist/css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="../../node_modules/font-awesome/css/font-awesome.min.css" />
<link rel="stylesheet" href="../../node_modules/leaflet/dist/leaflet.css" />
<link rel="stylesheet" href="../default.css" />
<style>
</style>
</head>
<body>
<app></app>

</body>
</html>
102 changes: 102 additions & 0 deletions examples/tooltip-directive/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// Shims
import 'reflect-metadata';
import 'zone.js';

import { YagaModule } from '../../lib/index'; // @yaga/leflet-ng2

import { Component, PlatformRef } from '@angular/core';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { Point, LatLng } from 'leaflet';

import { ExampleAppComponentBlueprint, IExampleProperties } from '../app-component-blueprint';
import { ExamplePropertiesModule, PROPERTIES_WRAPPER } from '../property.component';

const platform: PlatformRef = platformBrowserDynamic();

/* tslint:disable:max-line-length */
const template: string = `
<example-header [title]="'Tooltip-Directive'"></example-header>
<div class="container">
<div class="map">
<yaga-map>
<yaga-marker>
<yaga-tooltip
[(opened)]="getDuplexPropertyByName('opened').value"
[(opacity)]="getDuplexPropertyByName('opacity').value"
(open)="handleEvent('open', $event)"
(close)="handleEvent('close', $event)"
[className]="getInputPropertyByName('className').value"
[interactive]="getInputPropertyByName('interactive').value"
[sticky]="getInputPropertyByName('sticky').value"
[direction]="getInputPropertyByName('direction').value"
[permanent]="getInputPropertyByName('permanent').value"
[offset]="getInputPropertyByName('offset').value"
>
{{ getDuplexPropertyByName('content').value }}
<!--
It would also be possible to pass the content with:
[(content)]="getDuplexPropertyByName('content').value"
-->
</yaga-tooltip>
</yaga-marker>
<yaga-tile-layer [url]="'http://a.tile.openstreetmap.org/{z}/{x}/{y}.png'"></yaga-tile-layer>
</yaga-map>
</div>
${ PROPERTIES_WRAPPER }
</div><!-- /.container -->
<example-footer></example-footer>
`;
/* tslint:enable */

/* tslint:disable:max-classes-per-file */
@Component({
selector: 'app',
template,
})
export class AppComponent extends ExampleAppComponentBlueprint {
public properties: IExampleProperties = {
duplex: [
{name: 'content', value: 'Some example content...', type: 'text' },
{name: 'opened', value: false, type: 'checkbox' },
// {name: 'lat', value: 51, type: 'number' },
// {name: 'lng', value: 7, type: 'number' },
// {name: 'position', value: new LatLng(51, 7), type: 'latlng' },
{name: 'opacity', value: 0.75, type: 'relative' },
],
input: [
{name: 'className', value: 'example-css-class', type: 'text' },
{name: 'pane', value: 'tooltip', type: 'text' },
{name: 'interactive', value: true, type: 'checkbox' },
{name: 'sticky', value: true, type: 'checkbox' },
{
additional: { states: ['right', 'left', 'top', 'bottom', 'center', 'auto']},
name: 'direction',
type: 'select',
value: 'auto',
},
{name: 'permanent', value: true, type: 'checkbox' },
{name: 'offset', value: new Point(0, 0), type: 'point' },
],
output: [
{name: 'open', value: '', type: 'event' },
{name: 'close', value: '', type: 'event' },
],
};
}

@NgModule({
bootstrap: [ AppComponent ],
declarations: [ AppComponent ],
imports: [ BrowserModule, FormsModule, YagaModule, ExamplePropertiesModule ],
})
export class AppModule { }

document.addEventListener('DOMContentLoaded', () => {
platform.bootstrapModule(AppModule);
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "npm run lint && npm run transpile && istanbul cover _mocha -- -- test/*.js",
"browser-test": "npm run transpile; browserify test/index.js -o browser-test/bundle.js",
"doc": "typedoc --out ./typedoc/ --mode file ts/",
"build-examples": "set -x && npm run transpile && cd examples && tsc; browserify geojson-directive/index.js -o geojson-directive/bundle.js && browserify tile-layer-directive/index.js -o tile-layer-directive/bundle.js && browserify wms-layer-directive/index.js -o wms-layer-directive/bundle.js && browserify map-component/index.js -o map-component/bundle.js && browserify zoom-control-directive/index.js -o zoom-control-directive/bundle.js && browserify layers-control-directive/index.js -o layers-control-directive/bundle.js && browserify scale-control-directive/index.js -o scale-control-directive/bundle.js && browserify attribution-control-directive/index.js -o attribution-control-directive/bundle.js && browserify circle-marker-directive/index.js -o circle-marker-directive/bundle.js && browserify image-overlay-directive/index.js -o image-overlay-directive/bundle.js && browserify icon-directive/index.js -o icon-directive/bundle.js && browserify div-icon-directive/index.js -o div-icon-directive/bundle.js && browserify passau/index.js -o passau/bundle.js && browserify circle-directive/index.js -o circle-directive/bundle.js && browserify marker-directive/index.js -o marker-directive/bundle.js && browserify floor-plan/index.js -o floor-plan/bundle.js"
"build-examples": "set -x && npm run transpile && cd examples && tsc; browserify tooltip-directive/index.js -o tooltip-directive/bundle.js && browserify popup-directive/index.js -o popup-directive/bundle.js && browserify geojson-directive/index.js -o geojson-directive/bundle.js && browserify tile-layer-directive/index.js -o tile-layer-directive/bundle.js && browserify wms-layer-directive/index.js -o wms-layer-directive/bundle.js && browserify map-component/index.js -o map-component/bundle.js && browserify zoom-control-directive/index.js -o zoom-control-directive/bundle.js && browserify layers-control-directive/index.js -o layers-control-directive/bundle.js && browserify scale-control-directive/index.js -o scale-control-directive/bundle.js && browserify attribution-control-directive/index.js -o attribution-control-directive/bundle.js && browserify circle-marker-directive/index.js -o circle-marker-directive/bundle.js && browserify image-overlay-directive/index.js -o image-overlay-directive/bundle.js && browserify icon-directive/index.js -o icon-directive/bundle.js && browserify div-icon-directive/index.js -o div-icon-directive/bundle.js && browserify passau/index.js -o passau/bundle.js && browserify circle-directive/index.js -o circle-directive/bundle.js && browserify marker-directive/index.js -o marker-directive/bundle.js && browserify floor-plan/index.js -o floor-plan/bundle.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit b0f21ca

Please sign in to comment.