Getting County Name in MapKit JS 'Place' object

On iOS, we could get the 'subAdministrativeArea' in CLPlacemark when doing a reverse geocode via MapKit, which, in the US, gives us the county name.

How do we get the equivalent county name when using MapKit JS?

The Place object that is returned doesn't have a subAdministrativeArea and doesn't seem to have any other property for county name?

The subAdministrativeArea is in the search payload. There just needs to be a tiny change to mapkit.js to add it to the Place object.

  1. Download mapkit.js
  2. Find and replace:
this.subLocality=t.subLocality,

with

this.subLocality=t.subLocality,this.subAdministrativeArea=t.subAdministrativeArea,

There were two instances in my copy of version 5.75.4

I hope apple fixes this in the next dot version, and lets each of us know that it has been fixed.

Getting County Name in MapKit JS 'Place' object
 
 
Q