-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
45 changed files
with
6,721 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'contribute', | ||
template: ` | ||
<h1>Contributing</h1> | ||
<p><code>angular2-baidu-map</code> is hosted on <a href="https://github.com/leftstick/angular2-baidu-map" target="_blank">GitHub</a>. If you find a bug, please use <a href="https://github.com/leftstick/angular2-baidu-map/issues" target="_blank">issue</a> system to report it, or fork this repository, fix it and give a pull request. Contributions are more than welcome</p> | ||
`, | ||
}) | ||
export class ContributeComponent { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule } from '@angular/router'; | ||
import { CommonModule } from '@angular/common'; | ||
|
||
import { BaiduMapModule } from '../../../src'; | ||
|
||
import { HomeRouteModule } from './route.module'; | ||
|
||
import { HomeComponent } from './index.component'; | ||
import { GithubComponent } from './github.jparrowsec.cnponent'; | ||
import { VersionComponent } from './version.component'; | ||
import { ContributeComponent } from './contribute.component'; | ||
import { AboutComponent } from './about.component'; | ||
|
||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
BaiduMapModule.forRoot({ ak: 'gd0GyxGUxSCoAbmdyQBhyhrZ' }), | ||
HomeRouteModule | ||
], | ||
exports: [ | ||
RouterModule | ||
], | ||
declarations: [ | ||
HomeComponent, | ||
GithubComponent, | ||
VersionComponent, | ||
ContributeComponent, | ||
AboutComponent | ||
] | ||
}) | ||
export class HomeModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
|
||
import { HomeComponent } from './index.component'; | ||
|
||
const routes: Routes = [ | ||
{ | ||
path: 'home', | ||
component: HomeComponent | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ | ||
RouterModule.forChild(routes) | ||
], | ||
exports: [ | ||
RouterModule | ||
] | ||
}) | ||
export class HomeRouteModule { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'version', | ||
template: ` | ||
<h1>Version</h1> | ||
<p>There are 3 major versions available, and each of them is not backwards compatible. Which means you should not writing codes at version 2's instruction, but with version 3 installed. Below are documentation references for previous versions:</p> | ||
<br/> | ||
<ul> | ||
<li><a href="https://github.com/leftstick/angular2-baidu-map/tree/3.x" target="_blank">version 2.x</a></li> | ||
<li><a href="https://github.com/leftstick/angular2-baidu-map/tree/3.x" target="_blank">version 3.x</a></li> | ||
</ul> | ||
`, | ||
}) | ||
export class VersionComponent { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'import', | ||
template: ` | ||
<h1>Import</h1> | ||
<ul class="menu" highlight> | ||
<li> | ||
<div> | ||
<div class="type-name">Typescript:</div> | ||
<div class="snippet"> | ||
<pre><code class="typescript">import { BaiduMapModule } from 'angular2-baidu-map';</code></pre> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
`, | ||
}) | ||
export class ImportComponent { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'quickstart', | ||
template: ` | ||
<div class="container"> | ||
<h1 class="page-title">Quickstart</h1> | ||
<p style="margin-bottom: 15px;">To start using <code>angular2-baidu-map</code>, follow these simple steps for module setup. Afterwards, read <a href="#!/apidoc">API documentation</a> to learn about advanced usage.</p> | ||
<install class="section"></install> | ||
<import class="section"></import> | ||
<usage class="section"></usage> | ||
</div> | ||
`, | ||
styles: [ | ||
` | ||
:host { | ||
width: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
baidu-map { | ||
width: 800px; | ||
height: 290px; | ||
} | ||
.home-desc { | ||
width: 800px; | ||
} | ||
@media screen and (max-width: 800px) { | ||
baidu-map, | ||
.home-desc { | ||
width: 100%; | ||
} | ||
} | ||
` | ||
] | ||
}) | ||
export class QuickstartComponent { | ||
|
||
constructor() { | ||
|
||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'install', | ||
template: ` | ||
<h1>Install</h1> | ||
<ul class="menu" highlight> | ||
<li> | ||
<div> | ||
<div class="type-name">Npm:</div> | ||
<div class="snippet"> | ||
<pre><code class="bash">npm install angular2-baidu-map --save</code></pre> | ||
</div> | ||
</div> | ||
</li> | ||
</ul> | ||
`, | ||
}) | ||
export class InstallComponent { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
|
||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'usage', | ||
template: ` | ||
<h1>Usage</h1> | ||
<ul class="menu" highlight> | ||
<li> | ||
<div> | ||
<div class="type-name">Use <code>angular2-baidu-map</code> module:</div> | ||
<div class="snippet"> | ||
<pre><code class="typescript">import { BaiduMapModule } from 'angular2-baidu-map'; | ||
import { DemoComponent } from './demo.component'; | ||
@NgModule({ | ||
imports: [ | ||
BrowserModule, | ||
BaiduMapModule.forRoot({ ak: 'your ak' }) | ||
], | ||
declarations: [ | ||
DemoComponent | ||
], | ||
bootstrap: [DemoComponent] | ||
}) | ||
export class DemoModule { }</code></pre> | ||
</div> | ||
</div> | ||
</li> | ||
<li> | ||
<div> | ||
<div class="type-name">Use <code><baidu-map></code> element:</div> | ||
<div class="snippet"> | ||
<pre><code class="typescript">import { Component } from '@angular/core'; | ||
import { MapOptions } from 'angular2-baidu-map'; | ||
@Component({ | ||
selector: 'demo', | ||
template: '<baidu-map [options]="opts"></baidu-map>', | ||
styles: [` | ||
baidu-map { | ||
width: 800px; | ||
height: 290px; | ||
} | ||
` | ||
] | ||
}) | ||
export class DemoComponent { | ||
opts: MapOptions; | ||
constructor() { | ||
this.opts = { | ||
centerAndZoom: { | ||
lng: 121.506191, | ||
lat: 31.245554, | ||
zoom: 15 | ||
} | ||
}; | ||
} | ||
} | ||
</code></pre> | ||
</div> | ||
<blockquote>Map won't be visible if no size specified</blockquote> | ||
</div> | ||
</li> | ||
</ul> | ||
`, | ||
}) | ||
export class UsageComponent { } |
Oops, something went wrong.