1

I'm new in Angular 2, and i'm building dashboard application with openstreet map, thus i use this Angular2-openlayer.

When i try implementing this code

    <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>

i've got this error

No provider for SourceVectorComponent!

Can you guys help me about it?

And also, if you guys have more example using this plugin, i really appreciate it if you give me some links.

Thanks

bagas
  • 13
  • 3

1 Answers1

3

I don't know if you are still looking for the answer but I came across the same error and solved it.

You have to place your aol-feature inside 2 tags (aol-layer-vector and aol-source-vector).

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

I found the answer in the example app of ngx-openlayers ==> https://github.com/quentin-ol/ngx-openlayers/blob/master/example/src/app/app.component.html#L8

Hope it helps!

Reggi
  • 190
  • 2
  • 15
  • Thanks for your respon, btw i'm not using this component anymore, i'm using native openlayer. so, i can't test your answer, but thanks. if anybody get this answer helpful, don't forget to vote it up. – bagas Feb 12 '18 at 09:41