Skip to content

New release breaks line scaling #63

@DRuggeri

Description

@DRuggeri

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions