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

Workaround for usage with sidebarmarkers component #12

Open
Plastikmensch opened this issue Jun 22, 2022 · 0 comments
Open

Workaround for usage with sidebarmarkers component #12

Plastikmensch opened this issue Jun 22, 2022 · 0 comments

Comments

@Plastikmensch
Copy link
Owner

It is not recommended to use dynmaps undocumented sidebarmarkers component with this plugin, as it causes a huge memory spike on dynmap, which causes OOM.

Ideally this should be fixed upstream by adding an optional config key to markersets like "showonsidebar" which defaults to false.

Workaround for now

Step one:

Edit sidebarmarkers.js
This has to be done every time you update dynmap

In the UpdateMarkers function change:

$.each(markersets, function (key, set) {
	if (!set.markers || $.isEmptyObject(set.markers)) {
		return;
	}

to:

$.each(markersets, function (key, set) {
	if (!set.markers || $.isEmptyObject(set.markers) || (!cfg.enabled_sets.includes(set.label) && !cfg.enabled_sets.includes(set.id))) {
		return;
	}

Step two:

Enable sidebarmarkers and markersets in configuration.txt

# Enable undocumented sidebarmarkers. Shows markers in sidebar.
  - class: org.dynmap.ClientComponent
    type: sidebarmarkers
    title: 'Markers'
    # List of enabled sets
    enabled_sets:
      - "markers"

enabled_sets works with label and id. "markers" is the id of the default markerset.

@Plastikmensch Plastikmensch pinned this issue Jun 27, 2022
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

1 participant