DefinitelyTyped/types/apple-mapkit-js/apple-mapkit-js-tests.ts
Chris Drackett 2ef13b1431 Update mapkit types to 5.18 (#37960)
* update apple-mapkit-js types to 5.18

also add docs/comments

* apple mapkit is not on NPM

* fixing tests

* Update index.d.ts

* Update tslint.json

* Update tslint.json

* revert removal of rules so checks pass.
2019-09-17 14:58:55 -04:00

31 lines
692 B
TypeScript

mapkit.init({
language: 'en',
authorizationCallback: done => {
done('my-map-token');
},
});
const map: mapkit.Map = new mapkit.Map(
document.querySelector<HTMLElement>('.test'),
{
isZoomEnabled: true,
isRotationEnabled: false,
tintColor: 'green',
},
);
const colors = mapkit.Map.ColorSchemes.Dark;
const coordinate = new mapkit.Coordinate(1000, 1000);
const factory = (coordinate: mapkit.Coordinate) => {
const el = document.createElement('div');
el.textContent = `${coordinate.longitude}, ${coordinate.latitude}`;
return el;
};
map.addAnnotation(new mapkit.Annotation(coordinate, factory));
const mapPoint: mapkit.MapPoint = coordinate.toMapPoint();