Lightship maps integration with VPS Coverage API - HowToGuide wrong?

Include the following details (edit as applicable):

  • Issue category: ARDK Documentation / Unity How-To Guides
  • Device type & OS version: Android
  • Host machine & OS version: Windows 10
  • Issue Environment : Engine
  • Xcode version:
  • ARDK version: 2.5.2
  • Unity version: 2021.3.24f1 (LTS)

Description of the issue:
I follow this how to Guide (How to Integrate the VPS Coverage API with Lightship Maps | Niantic Lightship), however, I am stuck on Converting the LocationInfo “mapCenter” to LatLng. The proposed method in the HowToGuide “ToArdkLatLng()” does not seem to exist according to error message. I also could not find said method in the LatLng namespace. Can you help me out?

‘LatLng’ does not contain a definition for ‘ToArdkLatLng’ and no accessible method accepting a first argument of type ‘LatLng’ could be found (are you missing a using directive or an assembly reference?)

I ran into some other issues before, so I had to add other namespaces, here are my current ones in the script:
Niantic.Lightship.Maps
Niantic.ARDK.VPSCoverage
Niantic.ARDK.Extensions
Niantic.ARDK
ArdkLatLng = Niantic.ARDK.LocationService.LatLng
MapsLatLng = Niantic.Lightship.Maps.Core.Coordinates.LatLng
Niantic.Lightship.Maps.MapLayers.Components
Niantic.ARDK:LocationService
System
System.Collections
System.Collections.Generic
UnityEngine

EDIT: The script at the end of the How-To Guide is correct. It is only in the step by step guide, that the code is wrong.

Fixed it, here’s how I resolved it:

public void RequestAreasAroundMapCenter(){
var mapCenter = _mapView.MapCenter;
var mapCenterARDK = ConvertArdkLatLng(mapCenter);
_coverageClient.RequestCoverageAreas(mapCenterARDK, _queryRadius, OnAreasResult);
}

public void OnAreasResult(CoverageAreasResult areaResult){

foreach(var area in areaResult.Areas){
            var areaID = area.LocalizationTargetIdentifiers[0];
            var areaShapeMaps = ConvertMapsLatLng(area.Shape)
           _areaBorder.DrawLoop(areaShapeMaps, areaID)

}

This topic was automatically closed 2 hours after the last reply. New replies are no longer allowed.