ngx-openlayers
ngx-openlayers copied to clipboard
Render Geojson
Hi, How could I render a Geojson in this component.
With that template I retrieve GeoJSON data from my server and display it over a slippy map.
<div>
<aol-map #map1 [width]="mapWidth" [height]="mapHeight">
<aol-layer-tile>
<aol-source-xyz [url]="tileServer"></aol-source-xyz>
</aol-layer-tile>
<aol-layer-vector [visible]="'true'">
<aol-source-geojson
[url]="'http://localhost:4200/geojson-service/object_points'"
[featureProjection]="'EPSG:4326'">
</aol-source-geojson>
<aol-style>
<aol-style-icon [src]="'http://localhost:4200/assets/icons/map/my_pin.svg'" [scale]="scale"
[anchorOrigin]="'bottom-left'" [anchor]="[0.5, 0]"></aol-style-icon>
</aol-style>
</aol-layer-vector>
</aol-map>
</div>
How to do this from TS?
- Get map instance
- Add new layer to the instance