0

I'm trying to build the Simple HERE SDK App using the following link.

https://developer.here.com/documentation/ios-premium/3.17/dev_guide/topics/app-simple-swift.html

I get to the step 4 (Implement NMAMapView setup and lifecycle code by replacing viewDidLoad() function with viewWillAppear(animated) and addMapCircle():)

override func viewWillAppear(_ animated: Bool) {
  super.viewWillAppear(animated)
  mapView.useHighResolutionMap = true
  mapView.zoomLevel = 13.2
  mapView.set(geoCenter: NMAGeoCoordinates(latitude: 49.258867, longitude: -123.008046),
    animation: .linear)
  // Note, logo is not shown when its size is greater than 1/8 of NMAMapView's height or width.
  mapView.copyrightLogoPosition = NMALayoutPosition.bottomCenter
  addMapCircle()
}

func addMapCircle() {
  if mapCircle == nil {
    let coordinates: NMAGeoCoordinates =
      NMAGeoCoordinates(latitude: 49.258867, longitude: -123.008046)
    mapCircle = NMAMapCircle(coordinates: coordinates, radius: 50)
    mapView.add(mapCircle!)
  }
}

Couple of issues:

  1. mapView.useHighResolutionMap = true then Xcode is saying that there is no member 'useHighResolutionMap'

  2. if mapCircle == nil { then Xcode says Cannot find 'mapCircle' in scope

This is official sample code, so I would expect it to work?

If I comment out //mapView.useHighResolutionMap = true and references to the addMapCircle code then the project builds.

VictorKahn
  • 33
  • 4
  • It seems like they aren't great at updating their getting started documentation. `useHighResolutionMap` doesn't seem to be a valid property any more. Delete that line. You also need to add a property `var mapCircle: NMAMapCircle?`. Good luck – Paulw11 Mar 20 '21 at 21:39
  • Thanks Paulw11. It's never a good start when the simple instructions are not unto date. – VictorKahn Mar 21 '21 at 22:31

0 Answers0