-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@types/leaflet] geoJSON() complains about arrays while documentation states they are valid #60930
Comments
someonewithpc
added a commit
to someonewithpc/DefinitelyTyped
that referenced
this issue
Jul 20, 2022
Fixed by #61339 |
Hi Issue link : https://github.com/PaulLeCam/react-leaflet/issues/1015#issue-1331955818 Please provide me any suggestions to what I should do to resolve this. |
someonewithpc
added a commit
to someonewithpc/DefinitelyTyped
that referenced
this issue
Aug 17, 2022
someonewithpc
added a commit
to someonewithpc/DefinitelyTyped
that referenced
this issue
Aug 17, 2022
@asamad-hitachi until you get the fix, you can create a // fix leaflet's geoJSON type definition
// todo remove after github issue has been resolved
// @see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/60930
import { GeoJsonObject } from 'geojson'
import { GeoJSON } from 'leaflet'
declare module 'leaflet' {
function geoJSON<P = never>(
geojson?: GeoJsonObject | GeoJsonObject[],
options?: GeoJSONOptions<P>
): GeoJSON<P>
} |
typescript-bot
pushed a commit
that referenced
this issue
Sep 15, 2022
…ds, as of version 1.8 by @someonewithpc * Leaflet: Update definitions to include missing methods found in 1.8 A declaration was generated with `dts-gen` and compared with the existing definition, merging them manually to add missing methods * Leaflet: Explicitly define `Evented.listens` with the corresponding function type and fix linter errors * Leaflet: Add tests for added methods * Leaflet: Add missing Mixin export * Allow L.geoJSON to accept geojson.GeoJsonObject[], fixing #60930 * Temporarily duplicate the implementation of Events and Evented, so tests pass * Fix toGeoJson(precision?: number | false) argument for all overrides * Add missing properties, as pointed out by DangerBotOSS * Add a 'tileabort' event when a tile load is cancelled See Leaflet/Leaflet#6786 * Make changes reported in Leaflet's Changelog - Make DivOverlay / Tooltip interactive (#7531, #7532 by @johnd0e) - Add openOn, close, toggle functions to DivOverlay (#6639 by @johnd0e) - Introduce DomEvent.off(el) to remove all listeners (#7125 by @johnd0e) - Allow preventing round-off errors by passing false to Util.formatNum / toGeoJSON (#7100 by @johnd0e) - Add autoPanOnFocus to Marker (#8042 by @IvanSanchez) - Add referrerPolicy to TileLayer (#7945 by @natevw) - Add playsInline to VideoOverlay (#7928 by @Falke-Design) - Add getCenter to ImageOverlay (#7848 by @Falke-Design) - Fire a tileabort event when a TileLayer load is cancelled (#6786 by @dstndstn) - Add crossOrigin to Icon (#7298 by @syedmuhammadabid)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Discussed in #60818
Originally posted by ma7moudat June 15, 2022
The official Leaflet documentation states:
However, when using Typescript, it complains when an array is passed to
geoJSON()
:The text was updated successfully, but these errors were encountered: