locked
styleURLs passed to registerModule are being ignored RRS feed

  • Question

  • Microsoft.Maps.registerModule("MyModule", "a.js", {styleURLs:["a.css"]})

    The stylesheets given to the call to registerModule are not being loaded.

    Inspecting the implementation of registerModule, we find a "for" loop constructed thusly:

    for (f = 0, s = r.styleURLs.length; f > s; f++)

    Note the loop condition will never be true.

    Further, external stylesheet references should be included via a "link" element with an href, not a "style" element with content as the current implementation is doing:

    e = document.createElement("style"),
    e.type = "text/css",
    e.textContent = r.styleURLs[f]



    • Edited by Posef Tuesday, June 6, 2017 6:46 PM
    Tuesday, June 6, 2017 6:41 PM

Answers

  • Good news, the team has fixed this issue in the experimental branch. This will be added to the main release branch in the next update, planned in the next month.

    [Blog] [twitter] [LinkedIn]

    Monday, June 26, 2017 5:52 PM

All replies

  • Thanks for highlighting this. Don't think anyone has used this since V8 was released. Will log a bug for the team to look into.

    [Blog] [twitter] [LinkedIn]

    Tuesday, June 6, 2017 7:10 PM
  • Good news, the team has fixed this issue in the experimental branch. This will be added to the main release branch in the next update, planned in the next month.

    [Blog] [twitter] [LinkedIn]

    Monday, June 26, 2017 5:52 PM