gergely-ujvari / npm-overlapping-marker-spiderfier

Npm pack https://github.com/fritz-c/OverlappingMarkerSpiderfier
ISC License
2 stars 0 forks source link

Steps on How to Initialize OMS #1

Open snow-drop opened 6 years ago

snow-drop commented 6 years ago

@gergely-ujvari, Good day. How could I use this library? I would like to integrate it in a VueJS app but I don't have any idea on how to initialize it. Something like:

const Spiderfier = require('npm-overlapping-marker-spiderfier')
const options = { legWeight: 3 }
this.oms = new Spiderfier(mapObject, options)

Or could I use this window.OverlappingMarkerSpiderfier? TIA

gergely-ujvari commented 6 years ago

Hello, pls. check https://github.com/jawj/OverlappingMarkerSpiderfier This repo is just a thin wrapping around it. I'd like to have a more sophisticated solution, but I needed this quickly.

After you require this module, window.OverlappingMarkerSpiderfier will be available.

snow-drop commented 6 years ago

@gergely-ujvari Did you mean like this

const Spiderfier = require('npm-overlapping-marker-spiderfier')

in 'require this module'?

And how could I use window.OverlappingMarkerSpiderfier? Sorry I have a little experience in Javascript so I don't have idea on this. Thanks

gergely-ujvari commented 6 years ago

@moonlight-purple.

Like this (using ES6 style import):

import "npm-overlapping-marker-spiderfier";

const options = { legWeight: 3 };
const spider = new window.OverlappingMarkerSpiderfier(options);

If you don't use ES6 style imports, replace the first line with: require('npm-overlapping-marker-spiderfier');

snow-drop commented 6 years ago

@gergely-ujvari I'll try this next week. I'll update you with the results. Thanks again! :)

snow-drop commented 6 years ago

@gergely-ujvari I've used the code you mentioned above but it's not working. The javascript console logs this error: window.OverlappingMarkerSpiderfier is not a constructor. Any idea on this?

ChristophePPLConnect commented 6 years ago

Hey! I have the exact same problem as @snow-drop.... Is there any news? Have you found a way to make it work?