Skip to content

Fix / Expose createMapController properly to let overriding#9425

Merged
ahukkanen merged 1 commit intodevelopfrom
fix/override-map-controller-9399
Jun 14, 2022
Merged

Fix / Expose createMapController properly to let overriding#9425
ahukkanen merged 1 commit intodevelopfrom
fix/override-map-controller-9399

Conversation

@ferblape
Copy link
Copy Markdown
Contributor

🎩 What? Why?

This PR fixes how the maps controller is being exposed to let it being overriden to use a custom controller.

📌 Related Issues

Testing

In a new development app I've added the following snippet to app/packs/decidim/decidim_application.js:

class SwisstopoMapController {
  start() {
    console.log('SwisstopoMapController start');
  }

  load() {
    console.log('SwisstopoMapController load');
  }

  setCoordinateReferenceSystem() {
    console.log('SwisstopoMapController setCoordinateReferenceSystem');
  }

  addTileLayers() {
    console.log('SwisstopoMapController addTileLayers');
  }

  setViewport() {
    console.log('SwisstopoMapController setViewport');
  }
}

$(() => {
  window.Decidim.createMapController = (mapId, config) => {
    return new SwisstopoMapController(mapId, config);
  }
})

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing
Description

♥️ Thank you!

@furilo furilo added the project: PWA Barcelona City Council contract label Jun 13, 2022
@ahukkanen ahukkanen merged commit 95dc667 into develop Jun 14, 2022
@ahukkanen ahukkanen deleted the fix/override-map-controller-9399 branch June 14, 2022 18:11
@ahukkanen ahukkanen added type: fix PRs that implement a fix for a bug module: core labels Jun 15, 2022
andreslucena pushed a commit that referenced this pull request Jul 6, 2022
andreslucena pushed a commit that referenced this pull request Jul 6, 2022
ahukkanen pushed a commit that referenced this pull request Jul 8, 2022
Co-authored-by: Fernando Blat <fernando@blat.es>
andreslucena added a commit that referenced this pull request Jul 13, 2022
Co-authored-by: Fernando Blat <fernando@blat.es>
eliegaboriau pushed a commit to eliegaboriau/decidim that referenced this pull request Oct 25, 2022
@alecslupu alecslupu added this to the 0.27.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: core project: PWA Barcelona City Council contract type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

window.Decidim.createMapController is not exposed anymore

4 participants