In order to reuse the same code in both JS and Node, the code that parses ExternalData geojson should be as simple as possible, especially since we always get that data from the trusted PHP parser.
- php should normalize service and href variants into an HREF
- URL should always contain proper protocol and domain, e.g. https://maps.wikimedia.org/geoshape?...
- there should always be a service tag to simplify post-processing of the request
This way the JS code can always expect these two fields:
"ExternalData": { "service": "geoshape", "href": "https://maps.wikimedia.org/geoshape?ids=Q30" }