-
Notifications
You must be signed in to change notification settings - Fork 70
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
Typescript support #12
Comments
I am not familiar with TypeScript or Angular. Would you like to submit pull requests for including TypeScript definitions and an Angular example? |
The parent repo has a typing file, but this fork is ahead of the parent repo, So typing file will need to be modified, but I do not have any experience in writing typings for a JS project. If someone can write the typing file, I can probably add an Angular example. @noerw Are you familiar with Typescript? |
Yeah, a little bit. I can look into it. |
I started looking into it as well. I will keep you guys posted on progress. Using leaflet-sidebar.d.ts as base. |
fixed in 9873c90 |
@nickpeihl @noerw Will the version get a bump? B/c npm install 3.0.0 doesn't seem to give the latest changes. |
I just released v3.0.1 |
Can anyone here please give an example on actually how to use this in Typescript Angular? A little late to the game here sorry. I have been trying to integrate leaflet-sidebar-v2 for two days now with no luck. I tried '@runette/ngx-leaflet-sidebar' Angular wrapper but that requires a certain version of Angular to work. Thanks! |
@cwgrc2 What have you tried? Since Hopefully this helps:
|
Thanks for Responding Atif!
I am first taking Paul's Runette's advice of rebuilding all of my
node_modules with the latest of all of our add-on plugins.
Is it your contention above that we do not need the
'runnete/ngx-leaflet-sidebar' add-on and just use the leaflet-sidebar-v2
directly?
If so, I think I tried that, but I think I tried it without
the @types/leaflet install. So I will try that again first after the
re-install.
Thanks for your input!
Chris
scubagrant60@gmail.com
…On Mon, Apr 13, 2020 at 6:49 PM Atif Chaudhry ***@***.***> wrote:
What have you tried? Since leaflet-sidebar.d.ts is inside the project,
you shouldn't have to do a lot other than importing it.
Hopefully this helps:
// package.json
npm install -S leaflet leaflet-sidebar-v2
npm install -D @types/leaflet
// html
<div id="sidebar" class="leaflet-sidebar collapsed">
...
</div>
// controller
import * as L from 'leaflet';
import 'leaflet-sidebar-v2';
getSidebar() {
return L.control.sidebar({container: 'sidebar', autopan: true});
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#12 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOAPKSDYMN7SWPZN77I7GG3RMOXIBANCNFSM4EFXDFPQ>
.
|
Can Typerscript support be added for the sidebar? The parent repo has a file that can be dropped-in, or used as a starting point.
leaflet-sidebar.d.ts
Currently gives me the following error:
When trying to do the following (using autopan example):
And if possible, please add an angular 2+ example.
The text was updated successfully, but these errors were encountered: