question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Refreshing the map programatically

See original GitHub issue

Is it possible to reload/refresh the map without reloading the page itself? Somthing like:

const map = new jsVectorMap({ ... })
map.reload()

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
themustafaomarcommented, Apr 15, 2022

Hi @rushenn

the extend method should be called once, avoid calling extend method inside an event.

BTW, in the example, you don’t need to extend the map and do this too much logic just for changing the style, which my fail in the future as it’s not an official implementation, as a better solution you can tweak the style of the regions with CSS:

path.jvm-region {
    fill: var(--fill);
}
1reaction
themustafaomarcommented, Jun 25, 2021

You can destroy the map using destroy method, but unfortunately, you can’t recreate it again, it’s a very complex process.

However, you can manipulate the map there’re some methods you can use to remove or create objects, like markers , lines , series and resetting the map etc…

Also as a workaround I created this pen I think this is what you want to achieve https://codepen.io/themustafaomar/pen/WNpVLoG?editors=0010

Notice I’ve just published a new version v1.3.2 please update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to refresh a google map manually? - android
After this activity is closed I want to put the new, and the ealier saved markers on my google map. (so UPDATE the...
Read more >
Refreshing Search Properties | Maps JavaScript API
Call localContextMapView.search() to manually refresh Local Context data when no changes to current search properties are needed. If locationRestriction is set ...
Read more >
Auto Refresh of Google Map markers. - CodeProject
I read in data from the database and generate an XML file and overlay it on google maps. The code is exactly like...
Read more >
Refresh an external data connection in Excel - Microsoft Support
Refresh data in 3D Maps · In 3D Maps, go to the map you want to add data to. · Leave the 3D...
Read more >
How to Add Auto-Refresh Feature to the GMap - YouTube
GMap Complete Guide(All Videos) - https://www.youtube.com/playlist?list... GMap Part 1(How to load location on your map based on latitude ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found