mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* 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.
31 lines
692 B
TypeScript
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();
|