|
| 1 | +--- |
| 2 | +title: 'Changelog' |
| 3 | +description: Discover all the release notes for the Jsvectormap. |
| 4 | +--- |
| 5 | + |
| 6 | +## v1.5.3 (latest) |
| 7 | + |
| 8 | +- fix: dragging doesn't work on mobile devices ([#126](https://github.com/themustafaomar/jsvectormap/issues/126)) |
| 9 | + |
| 10 | +## v1.5.2 |
| 11 | + |
| 12 | +- fix(markers): get/clear selected markers |
| 13 | +- fix: series doesn't receive markers nor regions |
| 14 | +- fix(events): tooltip fails when it's disabled ([#117](https://github.com/themustafaomar/jsvectormap/issues/117)) |
| 15 | +- perf: massively improves performance when not using labels ([#115](https://github.com/themustafaomar/jsvectormap/pull/115)) |
| 16 | +- style: replace let with const for the sake of consistency |
| 17 | +- refactor: abstract the zoom handlers |
| 18 | +- style: replace let with const |
| 19 | +- style: imporve variable declaration |
| 20 | +- fix: zoom on mobile ([#104](https://github.com/themustafaomar/jsvectormap/issues/104)) |
| 21 | +- refactor: replace jsvectormap.js with index.js |
| 22 | + |
| 23 | +## v1.5.1 |
| 24 | + |
| 25 | +- fix: region label fails ([#92](https://github.com/themustafaomar/jsvectormap/issues/92)) |
| 26 | +- fix: add ability to customize circled markers ([#97](https://github.com/themustafaomar/jsvectormap/discussions/97)) |
| 27 | +- refactor: improve consistency & readability ([5cf594d](https://github.com/themustafaomar/jsvectormap/commit/5cf594d62d3ea1175d7a56e994a90740246fd778)) |
| 28 | + |
| 29 | +## v1.5.0 |
| 30 | + |
| 31 | +- feat(events): onRegion/MarkerClick support ([#29](https://github.com/themustafaomar/jsvectormap/issues/29)) |
| 32 | +- fix: shaky click selects a region ([#47](https://github.com/themustafaomar/jsvectormap/issues/47)) |
| 33 | +- fix: lines reposition fails |
| 34 | +- refactor: improve the destroy method |
| 35 | +- refactor: build an abstract class for components |
| 36 | +- refactor: improve consistency & remove addMarker entirely |
| 37 | +- feat: ability to remove a line or multiple lines |
| 38 | +- refactor: better name conventions ([#86](https://github.com/themustafaomar/jsvectormap/pull/86)) |
| 39 | +- refactor: move elements to components ([#81](https://github.com/themustafaomar/jsvectormap/pull/81)) |
| 40 | +- refactor: get selector from merged options directly |
| 41 | +- fix: too much recursion error ([#75](https://github.com/themustafaomar/jsvectormap/issues/75)) ([#76](https://github.com/themustafaomar/jsvectormap/pull/76)) |
| 42 | +- feat(lines): ability to remove lines ([#72](https://github.com/themustafaomar/jsvectormap/discussions/72)) |
| 43 | +- fix(typo): 'tranparent' typo in default options ([#71](https://github.com/themustafaomar/jsvectormap/pull/71)) |
| 44 | + |
| 45 | +### Release Notes |
| 46 | + |
| 47 | +Starting from v1.5.0 the `addLine` and `removeLine` are deprecated and will be removed soon, as an alternative please use `addLines` [see docs](/docs/lines) and `removeLines` [see docs](/docs/lines). |
| 48 | + |
| 49 | +Events `onRegionTooltipShow` and `onMarkerTooltipShow` will receive the native event as the first argument. |
| 50 | + |
| 51 | +```js |
| 52 | +const map = new jsVectorMap({}) |
| 53 | + |
| 54 | +// ❌ Avoid this in the future versions. |
| 55 | +map.addLine() |
| 56 | + |
| 57 | +// ✅ Use `addLines` method to add a line or multiple lines. |
| 58 | +map.addLines({ from: 'Palestine', to: 'Ukraine' }) |
| 59 | + |
| 60 | +map.addLines([ |
| 61 | + { from: 'United States', to: 'Egypt' }, |
| 62 | + { from: 'Palestine', to: 'Ukraine' }, |
| 63 | +]) |
| 64 | + |
| 65 | +// ❌ Avoid this in the future versions. |
| 66 | +map.removeLine('United States', 'Egypt') |
| 67 | + |
| 68 | +// ✅ Use `removeLines` method to remove multiple lines or all lines. |
| 69 | +map.removeLines() |
| 70 | + |
| 71 | +map.removeLines([{ from: 'United States', to: 'Egypt' }]) |
| 72 | + |
| 73 | +// Events |
| 74 | + |
| 75 | +const map = new jsVectorMap({ |
| 76 | + ... |
| 77 | + onRegionTooltipShow(event, tooltip, index) { |
| 78 | + // .. |
| 79 | + } |
| 80 | + onMarkerTooltipShow(event, tooltip, index) { |
| 81 | + // .. |
| 82 | + } |
| 83 | + ... |
| 84 | +}) |
| 85 | +``` |
| 86 | + |
| 87 | +## v1.4.5 |
| 88 | + |
| 89 | +- fix: jsvectormap constructor is not accessible ([#69](https://github.com/themustafaomar/jsvectormap/issues/69)) |
| 90 | +- refactor: drop webpack development server |
| 91 | +- docs: import typo |
| 92 | +- fix: touch events |
| 93 | + |
| 94 | +## v1.4.4 |
| 95 | + |
| 96 | +- fix: lines position fail when zooming in/out ([#63](https://github.com/themustafaomar/jsvectormap/issues/63)) |
| 97 | + |
| 98 | +## v1.4.3 |
| 99 | + |
| 100 | +- refactor: switch addMap, maps, defaults to static ([3b3b13d](https://github.com/themustafaomar/jsvectormap/commit/3b3b13d2a81907dc88dc809b36e9c0c45cf50e7e)) |
| 101 | +- revert: revert tooltip's css method ([83b7822](https://github.com/themustafaomar/jsvectormap/commit/83b782208d263f9802aded5f4b26c54519fd7e1f)) |
| 102 | +- fix: touch handlers ([fc4dbe4](https://github.com/themustafaomar/jsvectormap/commit/fc4dbe4dffea50d723f0490dc86c71170fc46f8b)) |
| 103 | +- chore: cleaning up ([a8be4ef](https://github.com/themustafaomar/jsvectormap/commit/a8be4effb41ea0ef59d802a3d03388fa2e15cccd)) |
| 104 | +- fix: marker's render function ([5136fae](https://github.com/themustafaomar/jsvectormap/commit/5136fae14f441ff3439ed82590f2a48fe471b60c)) |
| 105 | + |
| 106 | +### BREAKING CHANGES |
| 107 | + |
| 108 | +All other maps except `world` and `world_merc` are ignored from the npm package, but it's available on Github, you can download these maps from [Available maps](/docs/available-maps) page. |
| 109 | + |
| 110 | +## v1.4.2 |
| 111 | + |
| 112 | +- fix: tooltip not destroyed |
| 113 | + |
| 114 | +## v1.4.0 |
| 115 | + |
| 116 | +- refactor: drop dom handler class |
| 117 | +- refactor: move tooltip functionality to class [(#53)](https://github.com/themustafaomar/jsvectormap/pull/53) |
| 118 | +- fix: fix mouseup event & fix zoom buttons |
| 119 | +- refactor: clean up util api |
| 120 | +- refactor: refactor directory structure |
| 121 | +- fix: fix 'addMarkers' method doesn't work with arrays |
| 122 | +- fix(scroll): fix mouse wheel behavior [(#52)](https://github.com/themustafaomar/jsvectormap/pull/52) |
| 123 | + |
| 124 | +### BREAKING CHANGES |
| 125 | + |
| 126 | +In early versions the `map` container was an instance of a custom dom handler class that contains a `delegate` method, now it's just a DOM element, so the `delegate` method won't be available anymore. |
| 127 | + |
| 128 | +```js |
| 129 | +const map = new jsVectorMap({ |
| 130 | + // ... |
| 131 | + onLoaded: (map) => { |
| 132 | + // ❌ Won't work anymore. |
| 133 | + map.container.delegate('.jvm-region', 'click', (event) => { |
| 134 | + // .. |
| 135 | + }) |
| 136 | + |
| 137 | + // ✅ You will need to define your own event listener, example |
| 138 | + map.container.addEventListener('click', (event) => { |
| 139 | + if (event.target.matches('.jvm-region')) { |
| 140 | + // Do something |
| 141 | + } |
| 142 | + }) |
| 143 | + }, |
| 144 | + // ... |
| 145 | +}) |
| 146 | +``` |
| 147 | + |
| 148 | +#### Tooltip instance |
| 149 | + |
| 150 | +The tooltip also was a `DomHandler` instance, now it's a `Tooltip` instance which implements these methods `getElement`, `show`, `hide`, `text`, `css`. |
| 151 | + |
| 152 | +```js |
| 153 | +const map = new jsVectorMap({ |
| 154 | + // ... |
| 155 | + onMarkerTooltipShow(tooltip, index) { |
| 156 | + // ❌ Won't work anymore. |
| 157 | + const element = tooltip.selector |
| 158 | + |
| 159 | + // Do something with the tooltip DOM element.. |
| 160 | + |
| 161 | + // ✅ If you need the tooltip DOM element, you can access it like so: |
| 162 | + const element = tooltip.getElement() |
| 163 | + |
| 164 | + // Do something with the tooltip DOM element, or.. |
| 165 | + // tooltip.css({ backgroundColor: 'red' }) |
| 166 | + // tooltip.text('Hello') |
| 167 | + }, |
| 168 | + // ... |
| 169 | +}) |
| 170 | +``` |
| 171 | + |
| 172 | +## v1.3.3 |
| 173 | + |
| 174 | +- fix: dragging the map selects the region (#48) |
| 175 | +- fix: eventHandler's off method doesn't delete the reference |
| 176 | +- style: correct events names for consistency |
| 177 | +- feat: introduce a new event 'onDestroyed' |
| 178 | +- fix(add-markers): add markers method not working with object |
0 commit comments