0

I want to write this code in typescript:

I get correct visibleRegion, but I can't understand how to write code Location.distanceBetween(..) for calculate distance.

I have this code:

this.gMap = event.object.gMap;
var visibleRegion = this.gMap.getProjection().getVisibleRegion();
var farRight = visibleRegion.farRight;
var farLeft = visibleRegion.farLeft;
var nearRight = visibleRegion.nearRight;
var nearLeft = visibleRegion.nearLeft;
var diagonalDistance = new float[1]; //Cannot find name 'float'.ts(2304)

var farLeft = visibleRegion.farLeft;
var nearRight = visibleRegion.nearRight;

Location.distanceBetween( //Property 'distanceBetween' does not exist on type '{ new (): Location; prototype: Location; }'.ts(2339)
  farLeft.latitude,
  farLeft.longitude,
  nearRight.latitude,
  nearRight.longitude,
  diagonalDistance
);

return diagonalDistance[0] / 2; 

Have you any idea please? I wont to write in Typescript Code. Nativescript/ Angular

Random
  • 3,158
  • 1
  • 15
  • 25
web site
  • 99
  • 8

0 Answers0