Azure maps OGC Map layer Capabilities support

Pine, Michael 21 Reputation points
2020-11-04T21:07:09.09+00:00

Hi,

we are adding some map layers onto Azure maps using the OGC Map Layer and I have all the sample code working on a local project.

We have some in house built map layers that produce asset tiles for our infrastructure and I've spent a few days now trying to work out why the tiles are not being produced and it seems to be down to when the request is sent off for the tile that the azure maps service is not honouring the capabilities defined by the source service, specifically the "Styles" parameter is being lower cased to "default" instead of the reported "Default", this unfortunately causes the XML response "Styles value is not defined" if I take that same URL and replace the Styles=default with Styles=Default the map tile is produced as expected.

I can't seem to find any configuration options that will effect the url generation, so I am also going to open a support ticket but I was wondering if anyone has seen this behaviour as this basically means I will probably need to request the service that has been built to be modified to be case in sensitive as I have seen the sample WMS services work ok with the lower case default but I haven't seen their capabilities and what they report.

thanks
Michael

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
653 questions
0 comments No comments
{count} votes

Accepted answer
  1. rbrundritt 16,456 Reputation points Microsoft Employee
    2020-11-04T22:33:48.157+00:00

    I dug into this issue and found a bug in the spatial io module. I've reported it to the dev team, but not sure when it will be fixed in production. That said, I've come up with a simple workaround to unblock you. You can add an option when loading the map to transform requests before they are made. Adding the following to the map options when loading the map will look for this service, and change "default" to "Default". I tested it out with the service you provided and it seemed to work.

    transformRequest: function (url, requestType) {
        //Look for requests to the water service that is for an image
        if (url.indexOf('webmap.southeastwater.com.au/WMSWater') > -1) {
            //Using regular expression to replace in case there are multiple styles in the URL.
            return { url: url.replace(/default/gi, 'Default') };
        }
    
        return { url: url };
    }
    
    1 person found this answer helpful.

6 additional answers

Sort by: Most helpful
  1. Pine, Michael 21 Reputation points
    2020-11-04T22:36:24.927+00:00

    Setting is as an array seemed to get me the correct URL and if I place that URL into a browser it gives me the correct image but in the browser network tab I am getting a failed to load response message

    https://webmap.southeastwater.com.au/WMSWater/service.svc/get?FORMAT=image%2Fpng&HEIGHT=1024&LAYERS=Wa_Pipe_Sew_Opr&REQUEST=GetMap&STYLES=Default&TILED=true&TRANSPARENT=true&WIDTH=1024&VERSION=1.3.0&SERVICE=WMS&CRS=EPSG%3A3857&BBOX=16154507.305902291,-4598451.621636203,16155730.298354853,-4597228.629183641

    This URL works correctly and brings back a valid map tile but I'm getting an error when it attempts to load the tile and I am seeing nothing in the console log.

    0 comments No comments

  2. Pine, Michael 21 Reputation points
    2020-11-04T23:10:25.957+00:00

    Hi,

    so I replaced all of the code that I had which had quite a bit of "other" code and this is now showing the layer, which is of great comfort. Just one stupid
    question, with this layer being shown I am now now longer seeing the base maps layer, do I need to make sure I have a transparent setting somewhere ?

    Can't believe how much I appreciate your help with this, thank you so much.

    thanks
    Michael