Skip to content

Commit

Permalink
fix issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
leftstick committed Jul 29, 2016
1 parent 87d2c97 commit fefdaaa
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 62 deletions.
47 changes: 24 additions & 23 deletions demo/css/fontello.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?45417214');
src: url('../font/fontello.eot?45417214#iefix') format('embedded-opentype'),
url('../font/fontello.woff?45417214') format('woff'),
url('../font/fontello.ttf?45417214') format('truetype'),
url('../font/fontello.svg?45417214#fontello') format('svg');
font-family: 'icon';
src: url('../font/fontello.eot?86581095');
src: url('../font/fontello.eot?86581095#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?86581095') format('woff2'),
url('../font/fontello.woff?86581095') format('woff'),
url('../font/fontello.ttf?86581095') format('truetype'),
url('../font/fontello.svg?86581095#icon') format('svg');
font-weight: normal;
font-style: normal;
}
Expand All @@ -13,49 +14,49 @@
/*
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?45417214#fontello') format('svg');
font-family: 'icon';
src: url('../font/icon.svg?86581095#icon') format('svg');
}
}
*/

[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: "fontello";
font-family: "icon";
font-style: normal;
font-weight: normal;
speak: none;

display: inline-block;
text-decoration: inherit;
width: 1em;
margin-right: .2em;
text-align: center;
/* opacity: .8; */

/* For safety - reset parent styles, that can break glyph codes*/
font-variant: normal;
text-transform: none;

/* fix buttons height, for twitter bootstrap */
line-height: 1em;

/* Animation center compensation - margins should be symmetric */
/* remove if not needed */
margin-left: .2em;

/* you can be more comfortable with increased icons size */
/* font-size: 120%; */

/* Font smoothing. That was taken from TWBS */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;

/* Uncomment for 3D effect */
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
}
.icon-github:before { content: '\e800'; } /* '' */
.icon-globe:before { content: '\e801'; } /* '' */
.icon-github-1:before { content: '\e802'; } /* '' */
.icon-search:before { content: '\e803'; } /* '' */
.icon-location:before { content: '\e804'; } /* '' */

.icon-globe:before { content: '\e800'; } /* '' */
.icon-eye-off:before { content: '\e801'; } /* '' */
.icon-location:before { content: '\f031'; } /* '' */
.icon-github:before { content: '\f113'; } /* '' */
.icon-search:before { content: '\f50d'; } /* '' */
Binary file modified demo/font/fontello.eot
100644 → 100755
Binary file not shown.
18 changes: 11 additions & 7 deletions demo/font/fontello.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified demo/font/fontello.ttf
100644 → 100755
Binary file not shown.
Binary file modified demo/font/fontello.woff
100644 → 100755
Binary file not shown.
Binary file added demo/font/fontello.woff2
Binary file not shown.
3 changes: 2 additions & 1 deletion demo/js/demo.app.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@

<h4>Demonstration</h4>
<br/>
<baidu-map ak="5XO4WhIyUWAkSu9dvBq21mgc" [options]="opts" [offline]="offlineOpts" (onMapLoaded)="loadMap($event)" (onMarkerClicked)="clickMarker($event)"></baidu-map>
<baidu-map ak="5XO4WhIyUWAkSu9dvBq21mgc" [options]="opts" [offline]="offlineOpts" (onMapLoaded)="loadMap($event)" (onMarkerClicked)="clickMarker($event)" *ngIf="display"></baidu-map>
<br/>
<div class="center-align">
<a class="btn-floating blue" (click)="updateCoordinate($event)"><i class="icon-globe"></i></a>
<a class="btn-floating blue" (click)="updateMarker($event)"><i class="icon-location"></i></a>
<a class="btn-floating blue" (click)="updateZoom($event)"><i class="icon-search"></i></a>
<a class="btn-floating blue" (click)="toggleDisplay($event)"><i class="icon-eye-off"></i></a>
</div>
<br/>

Expand Down
9 changes: 7 additions & 2 deletions demo/js/demo.app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

import {Component, Input, OnInit, AfterContentInit} from '@angular/core';
import {BaiduMap, OfflineOptions, ControlAnchor, NavigationControlType} from '../../';
import { Component, Input, OnInit, AfterContentInit } from '@angular/core';
import { BaiduMap, OfflineOptions, ControlAnchor, NavigationControlType } from '../../';

var tpl = <string>require('./demo.app.tpl');
var style = <string>require('./demo.app.style');
Expand Down Expand Up @@ -43,6 +43,7 @@ export class MainApp implements OnInit, AfterContentInit {
offlineOpts: OfflineOptions;
privousCenter: Object = center1;
privousMarkers: Object[] = markers1;
display: boolean = true;

ngOnInit() {
this.opts = {
Expand Down Expand Up @@ -97,4 +98,8 @@ export class MainApp implements OnInit, AfterContentInit {
console.log('The clicked marker is', marker);
}

toggleDisplay(e: MouseEvent) {
this.display = !this.display;
}

}
3 changes: 3 additions & 0 deletions dist/angular2-baidu-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ return /******/ (function(modules) { // webpackBootstrap
if (!baiduMap || baiduMap.status !== MapStatus_1.MapStatus.LOADED) {
return;
}
if (changes['options'].isFirstChange() && !this.map) {
return;
}
var opts = changes['options'].currentValue;
CoreOperations_1.reCenter(this.map, opts);
CoreOperations_1.reZoom(this.map, opts);
Expand Down
Loading

0 comments on commit fefdaaa

Please sign in to comment.