-
Notifications
You must be signed in to change notification settings - Fork 28
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
fails if icon size is not specified in leaflet marker options object #4
Comments
Hi, @rpanjwani . I cannot get how do you arrive to this problem. Can you please make some code snippet to show this problem ? |
Will give errors and screw up the entire map. In this situation, the size is defined by the CSS, but it seems like the bouncing option depends on the size being pre-defined in the javascript to function correctly / at all.
Edit: It seems like just using Edit II: |
@fjeddy Hi, sorry for late reply. |
Hi, A specific use case for not defining the size in JS is when the same icon group has different sized icons. Where the class name is dynamic and size / style controlled by CSS. Solving the issue is simple enough, but in theory, shouldn't be necessary to solve to begin with, and requires the size to be defined in two locations, CSS and JS. Tho, for me, with the code stated above, i get the error as described. Your library intercepts and breaks markers that isn't using the bouncing functionality at all, due to iconSize not being defined. It doesn't do 12x12 for me (And it shouldn't). Will see if I can give a more specific example where it breaks. I have also been messing with different Leaflet versions as a lot of plugins are out-dated with newer versions, that might be a partially responsible for some of my headache. |
@fjeddy Please, check the following example and tell me how is your code is different: |
The same question happend to me. var baseIconCssTextArray=baseIconCssText.split(";"); and then the problem has been solved. |
Sorry for so delayed solution. Try release v1.1.5. It supposed to resolve problems with icon size |
I´m using the latest version and still have this problem. To fix this I had to add another else in _calculateTransforms function, adding the default iconSize
|
If i don't specify
iconSize
as an option when creating a marker, then the following line fails: https://github.com/hosuaby/Leaflet.SmoothMarkerBouncing/blob/master/leaflet.smoothmarkerbouncing.js#L841This doesn't work for me as my markers can have different icons and I don't want to load those images in order to calculate dimensions dynamically in js.
The text was updated successfully, but these errors were encountered: