GithubHelp home page GithubHelp logo

alex4401 / mediawiki-extensions-datamaps Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 4.0 3 MB

Interactive data maps extension without extra services needed.

Home Page: https://mediawiki.org/wiki/Extension:DataMaps

License: Other

PHP 34.96% JavaScript 56.06% Less 4.10% TypeScript 2.67% Python 2.21%
leaflet maps mediawiki

mediawiki-extensions-datamaps's Introduction

DataMaps extension

This is free software licensed under the GNU General Public License. Please see http://www.gnu.org/copyleft/gpl.html for further details, including the full text and terms of the license.

Overview

An extension for displaying interactive maps in articles with no external services. All data is kept and served from the wiki and maintained by editors. Initially made as a replacement for ARK: Survival Evolved Wiki's interactive maps on DOM nodes.

Repository | Issue tracker

Installation

If your wiki is hosted on wiki.gg, simply request the extension via their representatives.

Check the MediaWiki.org page otherwise.

MediaWiki support schedule

This extension's development tracks wiki.gg's platform - currently MediaWiki 1.39. All versioned releases of DataMaps target this version.

Documentation

  • Creating a map (planned)
  • Data format
  • JavaScript API for gadgets (planned)

Configuration

Check the MediaWiki.org page.

Gadgets

External scripts can hook into Data Maps to provide additional functionality without modifying core code.

  • All Leaflet APIs are public and left exposed under the ext.datamaps.leaflet module.
    • Custom Leaflet layers are exposed under ext.datamaps.leaflet.Ark.
    • Lazy-loaded. Depend (via mw.loader.using) on ext.datamaps.leaflet.
    • DataMap objects provide waitForLeaflet( function callback, [object? context] ).
  • All public APIs of this extension are exposed under window.mw.dataMaps. Check resources/core/index.js for all exposed classes.
  • mw.dataMaps.registerMapAddedHandler( function callback, [object? context] ) may be used to have a function called on every map initialised on current page. The callback receives one parameter, a DataMap instance.
    • Depend (via mw.loader.using) on ext.datamaps.bootstrap to use this.
  • Refer to the source code for information about the classes.

Leaflet

This repository only includes a static build of modified Leaflet. Source code including the modifications is found under this link.

Gadget implications

Certain Leaflet features may not be available when using DataMaps, check the forked repository for more details.

mediawiki-extensions-datamaps's People

Contributors

alex4401 avatar alistair3149 avatar amire80 avatar dependabot[bot] avatar translatewiki avatar weblate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mediawiki-extensions-datamaps's Issues

Track maps failing validation

The title sounds stupid, but maps should be softly re-validated on extension updates, and added to a tracking category of sorts.

  • Error tracking
  • Deprecations tracking

Hide empty marker groups in the legend

Currently we display all groups that are delivered over the inlined JSON configuration all the time, which may include groups with no associated markers. This becomes an empty toggle with no function, but confuses the user.

Additionally, visibility conditions may change at runtime and should be also used to evaluate toggle visibility. At least internal layers (such as bg:) should be queried.

A validation error in a group/layer stops validation for the field entirely

Test map:

{
	"image": "Blank.png",
	"groups": {
		"obelisk-blu e": { "name": "Error here", "fillColor": "#00a5ff", "size": 20, "icon": "Obelisk.png" },
		"obelisk green": { "name": "Green Obelisk", "fillColor": "#14e800", "size": 20, "icon": "Obelisk.png" },
		"obelisk-re d": { "name": "Error here", "fillColor": "#f70102", "size": 20, "icon": "Obelisk.png" }
	}
}

Backport the edit button on map embeds from v0.14.0

As map data is not contained within articles but instead separate data pages, an edit button can be shown to logged-in users to advertise the possibility.

This has been already implemented in the v0.14.0 in-dev branch, but should be backported to v0.13.5.

Refactor legend management in the frontend

  • Root element created at run-time and not in the parser
  • Clean up MarkerLegendPanel and MapLegend classes
  • Grant them clearer names
  • Move all initialisation logic from DataMap into respective classes
  • Perhaps move them onto an event-based approach

Cache current content bounds whenever recalculated

  • Change Leaflet.LatLngBounds getCurrentContentBounds() and Leaflet.LatLngBounds getPaddedContentBounds() signatures to include a bool invalidate parameter, and respect it.
  • Have any invalidation sources include this parameter.

[EPIC] Basic visual editor functionality

The visual editor should allow:

  • Changing a group's collectability status
  • Changing whether a group is shown by default
  • Adding markers to the map
  • Name markers, set description, image
  • Edit markers
  • View coordinates regardless of map and instance settings, preferably after a click on the map

Invalidate API caches whenever a mix-in is modified

Currently, mix-in edits will update the map pages, but as they're not modified themselves the API data is not forced to be regenerated.

Mix-in changes should clear cached API output for each of dependee maps' latest revisions.

[EPIC] Add an internal layer to filter markers by zoom level ranges

  • Define the layer format (possibly property with single level or one range of levels, zoom:3 or zoom:3-7)
  • Ensure there is no substantial performance cost (possibly index zoom requirements separately from usual layer checks)
  • Write-time validation for the layer instances
  • Extend the visibility manager to handle the layer
  • Have the client stream zoom layers from the API as needed
  • Ensure the client does not flicker (hide previous markers only after new ones are loaded and instantiated)
  • Consider putting irrelevant markers into "stasis" - take them out of active registered marker list, possibly destroy the Leaflet instances entirely

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.