jumpinjackie / mapguide-rest

REST Extension for MapGuide Open Source
GNU Lesser General Public License v2.1
26 stars 14 forks source link

MG 3.1.1 creatmap.json scale ranges #190

Open cleversolutions opened 5 years ago

cleversolutions commented 5 years ago

createmap.json is producing errors with default scale ranges in MG 3.1.1.

We are using rest-rc5 and migrating from an old server running MG 3.1.0 and rest-rc4 to a new one running 3.1.1 and rest-rc5. We packed everything up on the old server and installed the package on the new server so all layers, map definitions etc are the same. Running the same post to /rest/services/createmap.json on the 3.1.1 server results in an error in rest. Postman says Unexpected 'i' in "pretty view"; however, raw view will return some valid json. When I diff the difference between calls to createmap.json on the old and new server I get this notable difference for a specific layer:
3.1.1

"ScaleRange": [
          {
            "MinScale": 0,
            "MaxScale": "inf"
          }
        ]

3.1.0 "ScaleRange": [ null ]

I think the "inf" is causing rest to throw out an error.

On other layers there were some differences in the scaleRange as well 3.1.1

"ScaleRange": [
          {
            "MinScale": 0,
            "MaxScale": 1000000000000
          }
        ]

3.1.0

"ScaleRange": [ null ]

Our workaround was to set the max scale of the "inf" layer to 1000000000000 in maestro and createmap.json works again.

I tried rc4 with our 3.1.1 server to rule out a change between rc4 and rc5 and the error persisted. My best guess is that 3.1.1 is returning "inf" to rest, which doesn't like a non-numeric value. Maybe it's more a bug in 3.1.1 than in rest, or maybe this is already fixed in master, but thought I would put this out there in case someone else runs into this.