2017-04-11 8 views
0

私はAngular 2で新しく、openstreetマップでダッシュボードアプリケーションを構築していますので、これはAngular2-openlayerです。角2 + Openlayers SourceVectorComponentのプロバイダはありません

私はこのコード

<aol-map [width]="'100%'"> 
     <aol-view [zoom]="4.98"> 
      <aol-coordinate [x]="118.015776" [y]="-2.600029" [srid]="'EPSG:4326'"></aol-coordinate> 
     </aol-view> 

     <aol-layer-tile> 
      <aol-source-osm></aol-source-osm> 
     </aol-layer-tile> 

     <aol-feature> 
     <aol-geometry-point> 
      <aol-coordinate [x]="5" [y]="45" [srid]="'EPSG:4326'"></aol-coordinate> 
     </aol-geometry-point> 
     <aol-style> 
      <aol-style-circle [radius]="10"> 
       <aol-style-stroke [color]="'black'" [width]="2"></aol-style-stroke> 
       <aol-style-fill [color]="'green'"></aol-style-fill> 
      </aol-style-circle> 
     </aol-style> 
    </aol-feature> 

    </aol-map> 

を実装しようとすると、私はこのエラー

にSourceVectorComponent用ませプロバイダを得ませんでした!

皆さん、お手伝いできますか?

また、このプラグインを使用している人がもっといらっしゃいましたら、私にいくつかのリンクを教えていただければ幸いです。

おかげ

答えて

1

あなたはまだ答えを探しているなら、私は知らないが、私は同じエラーに出くわし、それを解決しました。

2つのタグ(aol-layer-vectorとaol-source-vector)の内側にaol-featureを配置する必要があります。

<aol-layer-vector> 
    <aol-source-vector> 
     //your <aol-feature> here 
    </aol-source-vector> 
</aol-layer-vector> 

私は、NGX-OpenLayersをの例のアプリで答えを見つけ==>https://github.com/quentin-ol/ngx-openlayers/blob/master/example/src/app/app.component.html#L8

はそれが役に立てば幸い!

+0

あなたのお返事ありがとう btw私はこのコンポーネントをもう使用していません。私はネイティブopenlayerを使用しています。 あなたの答えはテストできませんが、ありがとうございます。 誰かがこの回答を参考にした場合、投票することを忘れないでください。 – bagas