Page MenuHomePhabricator

Kartographer's Map.js : map.addDataLayer is not a function
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • (1) Create a map according "Help:Extension:Kartographer/Developer guide"
  • (2) Please use it carefully: use https://de.wikivoyage.org/wiki/MediaWiki:Gadget-ListingInfo.js in the version of 09:27, 16. Jul. 2022‎, make it active (it will take some time because it is a gadget). Use any page with vCard template(s) like Wettin, press on an "info" button (which opens a dialog) and press the globe action button. In the current gadget version I am adding the data with map.addGeoJSONLayer( mapData, layerOptions ).

What happens?:

  • No map is created. In the console of Firefox, the following error message occurs:
jQuery.Deferred exception: map.addDataLayer is not a function Map.js/initialize/<@https://de.wikivoyage.org/wiki/Wettin line 10 > injectedScript:699:497
mightThrow@https://de.wikivoyage.org/w/load.php?lang=de&modules=jquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector-2022&version=1cbng:49:881
Deferred/then/resolve/</process<@https://de.wikivoyage.org/w/load.php?lang=de&modules=jquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets&skin=vector-2022&version=1cbng:50:544

What should have happened instead?:

  • No error message
  • Map should be created

Software version (skip for WMF-hosted wikis like Wikipedia):

  • Kartographer: – (eab7e1c) 23:43, 30. Jan. 2023
  • Browser: Firefox 109.0.1 (64-Bit)

Other information (browser name/version, screenshots, etc.):

  • The failure occurs only if kartoBox.map is called with a data section.

Event Timeline

Change 887289 had a related patch set uploaded (by Awight; author: Awight):

[mediawiki/extensions/Kartographer@master] [WIP] Restore addDataLayer function

https://gerrit.wikimedia.org/r/887289

Integration can be reviewed in WIP form. Waiting on mapdata 0.9 to continue work.

awight subscribed.

Change 887289 merged by jenkins-bot:

[mediawiki/extensions/Kartographer@master] Restore static data initializer

https://gerrit.wikimedia.org/r/887289

thiemowmde claimed this task.