error in CameraPosition in ionic 3

0

I'm doing tests with googlemaps using ionic 3.14

I have managed to visualize the map,

Now I'm trying to perform geo-mapping to show my current location using the CameraPosition method This is the code that I was able to find

moveCamera(loc: LatLng){
 // create CameraPosition

let options: CameraPosition = {
  target: loc,
  zoom: 18,
  tilt: 30
};

this.map.moveCamera(options)

}

But I have an error in CameraPosition

ts] Generic type 'CameraPosition<T>' requires 1 type argument(s).

import CameraPosition

what is the error? , Thank you.

    
asked by Gerard_jcr 14.11.2017 в 03:31
source

1 answer

0

The solution is as follows, define the type that in this case is LatLng :

   moveCamera(loc: LatLng){
   // create CameraPosition
   let camaraPosition: CameraPosition<LatLng> = {
    target: loc,
    zoom: 18,
    tilt: 30
  };

  this.map.moveCamera(camaraPosition)
}
    
answered by 14.11.2017 / 04:01
source