2017-04-11 1 views
0

저는 앵귤러 2로 새롭고 openstreet 맵을 사용하여 대시 보드 애플리케이션을 구축하고 있습니다. 따라서 Angular2-openlayer을 사용합니다.Angular 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

여전히 답을 찾고 있다면 나도 몰라하지만이 같은 오류를 가로 질러 와서 그것을 해결.

aol-feature를 2 개의 태그 (aol-layer-vector 및 aol-source-vector) 안에 넣어야합니다.

<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이 구성 요소를 더 이상 사용하지 않고 기본 오픈 레이어를 사용하고 있습니다. 답변을 테스트 할 수는 없지만 감사합니다. 아무도이 답변을 얻은 경우 투표를하는 것을 잊지 마십시오. – bagas

관련 문제