I'm using iOS 100.6 and am trying to place a UIbutton on top of AGSMapView. In the View Controller MapView and the UIButton are under "View". The UIbutton is not a subview of MapView. How do I get other UI element in my view to be visible on top of the map. I have three other elements that I hide and unhide using "isHidden = true/false" and these cannot be displayed either. Code in Swift 4.2.
Here is the view:
Here is the code snippet:
let viewMap = AGSMapView(frame: .zero)
viewMap.map = AGSMap(basemapType: .navigationVector,
latitude: currentLocation.latitude, longitude: currentLocation.longitude,
levelOfDetail: zoomLevel)
viewMap.graphicsOverlays.add(overlay)
viewMap.touchDelegate = self
view = viewMap
view.bringSubviewToFront(btnSatelliteToggle)
I actually just solved this. Here is the updated code that works:
viewMap.map = AGSMap(basemapType: .navigationVector,
latitude: currentLocation.latitude, longitude: currentLocation.longitude,
levelOfDetail: zoomLevel)
viewMap.graphicsOverlays.add(overlay)
viewMap.touchDelegate = self
I removed:
let AGSMapView(frame: .zero)
as this prevented the map from being displayed in MapView.
Also, by not setting a view (thus using the default view controller "view") all siblings are available for display and can be controlled via "isHidden."