articodeltd / angular-cesium

JavaScript library for creating map based web apps using Cesium and Angular
https://github.com/articodeltd/angular-cesium/settings/pages
MIT License
178 stars 93 forks source link

ac-map-layer-provider not support wms #248

Closed hectormartin42 closed 5 years ago

hectormartin42 commented 5 years ago

Into component ac-map-layer-provider the switch for providers does not have implemented WebMapService

switch (this.provider) { case MapLayerProviderOptions.WebMapService: case MapLayerProviderOptions.WebMapTileService: case MapLayerProviderOptions.ArcGisMapServer: case MapLayerProviderOptions.SingleTileImagery: case MapLayerProviderOptions.BingMaps: case MapLayerProviderOptions.GoogleEarthEnterpriseMaps: case MapLayerProviderOptions.MapBox: case MapLayerProviderOptions.UrlTemplateImagery: this.layerProvider = new this.provider(this.options); break; case MapLayerProviderOptions.MapTileService: case MapLayerProviderOptions.OpenStreetMap: this.layerProvider = this.provider(this.options); break; case MapLayerProviderOptions.OFFLINE: this.layerProvider = this.createOfflineMapProvider(); break; default: console.log('ac-map-layer-provider: [provider] wasn\'t found. setting OFFLINE provider as default'); this.layerProvider = this.createOfflineMapProvider(); break; }

I tried with:

case MapLayerProviderOptions.WebMapService: this.layerProvider = this.createWebMapServiceProvider(this.options); break;

private createWebMapServiceProvider(options) { return new Cesium.WebMapServiceImageryProvider(options); }

This solution works fine for me but i do not know how to include it into the library

hectormartin42 commented 5 years ago

I made a pull request fixing it

eitanfr commented 5 years ago

Hi thx for the issue, The WMS option is supported under MapLayerProviderOptions.WebMapService

I tested it with the following option and it worked for me:

<ac-map-layer-provider *ngIf="appSettingsService.showMapLayer"
[provider]="MapLayerProviderOptions.WebMapService"
[options]="{
 url : 'https://nationalmap.gov.au/proxy/http://geoserver.nationalmap.nicta.com.au/geotopo_250k/ows',
    layers : 'Hydrography:bores',
    parameters : {
        transparent : true,
        format : 'image/png'
    }
}">
</ac-map-layer-provider>

Maybe you have another issue?

hectormartin42 commented 5 years ago

Thanks, that works fine.