Giter VIP home page Giter VIP logo

mapkit-typescript's Introduction

Build Status License Current Release

mapkit-typescript

TypeScript type definitions for MapKit JS.

Installation

First, install the types in your project:

# using npm
npm install --save-dev mapkit-typescript

# using yarn
yarn add --dev mapkit-typescript

Then, add node_modules/mapkit-typescript to your tsconifg.json file like so:

{
  "compilerOptions": {
    "typeRoots": [
      "node_modules/mapkit-typescript",
      "node_modules/@types"
    ]
  }
}

This will enable the TypeScript compiler to find and use this typing since it is not installed under node_modules/@types.

By default the compiler only looks at node_modules/@types for type declarations. If typeRoots does not already exist in the tsconfig.json file, make sure to include node_modules/@types as well.

Legal

MapKit and the Apple logo are trademarks of Apple Inc., registered in the U.S. and other countries.

mapkit-typescript's People

Contributors

chrisdrackett avatar erickit avatar wsmd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mapkit-typescript's Issues

New release of MapKit JS (v5.22.0)

New MapKit JS Release

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.

View Release Page

New release of MapKit JS (v5.29.0)

New MapKit JS Release

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.

View Release Page

publish to DefinitelyTyped?

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?

New release of MapKit JS (v5.23.0)

New MapKit JS Release

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.

View Release Page

expose interfaces?

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?

how to handle constants?

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!

New release of MapKit JS (v5.25.0)

New MapKit JS Release

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.

View Release Page

New release of MapKit JS (v5.21.0)

New MapKit JS Release

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.

View Release Page

addEventListener with strict type checking

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.

New release of MapKit JS (v5.20.3)

New MapKit JS Release

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.

View Release Page

New release of MapKit JS (v5.24.0)

New MapKit JS Release

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.

View Release Page

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.