Skip to content
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

some way to use this library without node compiling ? #52

Open
hayden-t opened this issue Jul 10, 2019 · 2 comments
Open

some way to use this library without node compiling ? #52

hayden-t opened this issue Jul 10, 2019 · 2 comments

Comments

@hayden-t
Copy link

Im a bit new to node, and it took me while to work out with your library that though not stated i (think) i had to use browserify to 'compile' the basics of your library to get it to work in the browser ?

Is there any way to use the library without this, eg just <script> tags includes ?

@hayden-t hayden-t changed the title some way to use this library with node compiling ? some way to use this library without node compiling ? Jul 10, 2019
@perliedman
Copy link
Owner

No, since it's built on modules (CommonJS), you have to bundle it to use in a browser.

Having a way to easily create a bundle is a good idea and something at least one person asked about before. I would happily accept a PR for this, but given that I don't actively work at this project, it's not likely I will add it anytime soon.

@psociety
Copy link

psociety commented Jul 1, 2021

@hayden-t probably late, but yes, there is:

<script src="https://bundle.run/[email protected]"></script>
<script>
const pathFinder = new geojsonPathFinder(geoJson);
const bestPath = pathFinder.findPath(start, end);
</script>

https://jsfiddle.net/6qugy0rm/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants