wsmd / mapkit-typescript Goto Github PK
View Code? Open in Web Editor NEW Typescript type definitions for MapKit JS
License: MIT License
Typescript type definitions for MapKit JS
License: MIT License
The MapKit JS 5.21.0 release includes a rotation gesture improvement.
Updates
Fixed bug where rotating the map with gesture was not working in Chrome on Android.
The currently supported version is 5.18.0.
The MapKit JS 5.22.0 release adds improvements to browser support.
New Features
Added pinch-zoom on trackpad support for Chrome and Firefox.
Updated
Improved performance of mouse wheel zoom for Firefox on Windows.
Prevented nontouch events from firing during touch gestures in Firefox.
The currently supported version is 5.18.0.
After following the instructions, I am not able to build without putting in a triple slash reference (/// <reference ) where mapkit is referenced in the library. Adding the node modules path to the typeRoots doesn't seem to do anything.
MapKit JS 5.19.1 has been released.
For more info: https://developer.apple.com/documentation/mapkitjs/mapkit_js_release_notes/mapkit_js_5_19_1.
The currently supported version is 5.13.3.
MapKit JS 5.24.0 includes various improvements, including changes to how the Apple Maps logo and Legal link are displayed.
Updates
Improved how marker annotations animate in and out of clusters.
Improved how annotation clusters are grouped, so that one annotation cluster never overlaps another.
The showItems
function now updates the map region in a way that encloses annotation callouts visible on selected annotations, so that any callouts showing will not be cut off the edge of the map.
The Legal link is now always shown, for all map dimensions.
The Apple Maps logo in the lower left corner is now displayed on maps with dimensions of 200 x 100 pixels and larger.
The time to detect a long-press
map event has been increased to 500 ms. See Handling Map Events for more information.
Improve how cameraZoomRange
and cameraBoundary
behave for users in China.
The currently supported version is 5.18.0.
there are mapkit typings on DefinitelyTyped right now but they aren't as well documented and are more incomplete than this package. Have you considered putting these types on DefinitelyTyped to ease their use?
MapKit JS 5.23.0 includes new APIs for region and zoom limits, an updated Maps logo, and more.
New Features
Added the cameraDistance
property, which sets the altitude of the camera above the center of the map. A change to the map's camera distance can be animated with setCameraDistanceAnimated
.
Added the cameraZoomRange
property, which restricts zooming to a specified minimum and maximum camera distance. A change to the map's camera zoom range can be animated with setCameraZoomRangeAnimated
.
Added the cameraBoundary
property, which restricts panning to a specified coordinate region. A change to the map's camera boundary can be animated with setCameraBoundaryAnimated
.
Enabled Directions support for users in China.
Updated logo in lower left corner from to Maps.
Updated
Fixed issue where importGeoJSON
would not import a GeometryCollection
nested within a Feature.
Improved how the default marker annotation color is set depending on the map's colorScheme
. Setting a marker annotation's color property to null
sets a default color that matches the current colorScheme
.
Updated the Legal link on the map to open a web page, instead of displaying a menu.
The currently supported version is 5.18.0.
MapKit JS 5.25.0 includes various improvements for controls, GeoJSON import, and annotation clusters.
Updates
MapKit JS controls (+/- buttons, compass, Legal link, and so on) are no longer affected by CSS on the enclosing page.
Updated the Legal link so it connects to HI-IN, IW-IL, and VI-VN localized pages when MapKit JS is running one of these languages.
Updated spacing on the Apple Maps logo.
Made various improvements to GeoJSON import, such as adding the ability to handle null geometries in Features, ensuring that an ItemCollection is returned even for single item imports, and improving error message reporting.
Improved clustering behavior when member annotations are on both sides of the antimeridian.
Ensured that annotationsInMapRect
does not return cluster annotations, to match the behavior of annotations
.
The currently supported version is 5.18.0.
The MapKit JS 5.20.3 release includes bug fixes and performance improvements.
Updates
Fixed bug where https:
was not selected for CDN URLs in some packaged and local environments. [48289622]
Improved annotation CSS to prevent collision with styles on host implementations.
Improved annotations to warn instead of throw an error in some selection and deselection cases.
Improved positioning logic for Annotation glyph text.
Improved performance of annotation image assets.
Fixed bug in callout where glyphImage
was always used instead of selectedGlyphImage
where appropriate.
The currently supported version is 5.18.0.
I'm currently migrating my react mapkit library to typescript from flow and I'm trying to use your typings instead of the flow typings I had written originally.
One thing that I'm not sure about the best way to handle is the constants provided by mapkit (map type, or FeatureVisibility as examples).
I could change these to just be normal strings but if possible a user should be required to pass in something like mapkit.FeatureVisibility.Adaptive
? I'm fairly new to typescript so any suggestions are super helpful!
I'm looking to piggyback on things like MarkerAnnotationConstructorOptions
to build a Mapkit react component. Is there a way that I would be able to use these directly vs. copying and pasting them?
First of all I wanted to say thank you for making this, it's awesome.
In mapkit.Annotation.d.ts
there is:
* @param listener The callback function to invoke. listener is passed an
* annotation event as its sole argument.
addEventListener<K extends keyof AnnotationEvents<this>>(
type: K,
listener: () => void,
thisObject?: object,
): void;
When I pass an object to a listener:
newMarker.addEventListener('select', (event: mapkit.EventBase<mapkit.MarkerAnnotation>) => {
const myAnnotation = event.target;
console.log('Clicked');
});
It errors that (event: ...) => void
is not assignable to () => void
.
Would it be better to declare the addEventListener as:
addEventListener<K extends keyof AnnotationEvents<this>>(
type: K,
listener: (event: mapkit.EventBase<any>) => void,
thisObject?: object,
): void;
Of note, I'm sure there is something better than any to put in there.
MapKit JS 5.29.0 improves accessibility, performance, and the appearance of controls when they are mirrored for right-to-left languages.
Updates
Improved the performance of importGeoJSON
by ensuring that the main thread is never blocked.
Updated controls so that when a user clicks or taps a control that has focus, it retains focus.
Ensured that controls that mirror for right-to-left languages also mirror the pressed state of the zoom buttons.
The currently supported version is 5.18.0.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.