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

New release breaks line scaling #63

Closed
DRuggeri opened this issue Feb 1, 2022 · 1 comment
Closed

New release breaks line scaling #63

DRuggeri opened this issue Feb 1, 2022 · 1 comment

Comments

@DRuggeri
Copy link
Contributor

DRuggeri commented Feb 1, 2022

Hello - the new release made today breaks lines when scaling in/out (with a very basic definition). This doesn't seem to be reflected in the examples, so perhaps it is something isolated to my config. This can be reproduced with the following sample HTML.

When pinning to 1.4.3 in the script tags from unpkg.com, zooming in/out causes the lines to stay "frozen" due to the following error in the console. Pinning to 1.4.2 causes the issue to go away.

Uncaught TypeError: this.lines[i].element.setStyle is not a function
    repositionLines https://unpkg.com/jsvectormap@1.4.3:1
    applyTransform https://unpkg.com/jsvectormap@1.4.3:1
    setScale https://unpkg.com/jsvectormap@1.4.3:1
    handleContainerEvents https://unpkg.com/jsvectormap@1.4.3:1
    on https://unpkg.com/jsvectormap@1.4.3:1
    handleContainerEvents https://unpkg.com/jsvectormap@1.4.3:1
    init https://unpkg.com/jsvectormap@1.4.3:1
    t https://unpkg.com/jsvectormap@1.4.3:1
    t https://unpkg.com/jsvectormap@1.4.3:1
    <anonymous> Backbone
jsvectormap@1.4.3:1:23996

The reproduction recipe HTML page:

<html>
<head>
<title>Error</title>
  <link rel="stylesheet" href="https://unpkg.com/jsvectormap@1.4.3/dist/css/jsvectormap.css" />
  <script src="https://unpkg.com/jsvectormap@1.4.3"></script>
  <script src="https://unpkg.com/jsvectormap@1.4.3/dist/maps/world.js"></script>
</head>

<body>
<div id="map" style="width: 100%; height: 95%"></div>
<script>

var markers = [
  { name: 'STL', coords: [38.627003, -90.199402]},
  { name: 'AMS', coords: [52.3676, 4.9041] },
];

var lines = [
  { from: 'STL', to: 'AMS', style: { stroke: 'Blue', strokeWidth: 1.5 } },
]

var map = new jsVectorMap({
  selector: "#map",
  map: "world",
  markers: markers,
  lines: lines,
});
</script>
</body>

I will try looking into this further, but wanted to file an Issue in case you already know where the problem may be coming from.

@themustafaomar
Copy link
Owner

Thank you for the clear reproduction of the issue, I've just fixed it at de815f9 and I'll publish the update on npm today.

Thank you!

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

2 participants