ngx-openlayers icon indicating copy to clipboard operation
ngx-openlayers copied to clipboard

Render Geojson

Open iamheiner opened this issue 7 years ago • 2 comments

Hi, How could I render a Geojson in this component.

iamheiner avatar Jan 25 '18 11:01 iamheiner

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>

OkieOth avatar Mar 04 '18 20:03 OkieOth

How to do this from TS?

  • Get map instance
  • Add new layer to the instance

mhosman avatar Jun 19 '18 19:06 mhosman