NUKnightLab / StoryMapJS

Maps that tell stories.
https://storymap.knightlab.com/
Other
183 stars 50 forks source link

Can't Change Font or Map Type #307

Open rosaliechan opened 8 years ago

rosaliechan commented 8 years ago

A Zendesk user was trying to make a custom StoryMap using advanced options, but cannot change the font (font_css) or map type (map_type), even though he used an approved font option and map type coded value.

JoeGermuska commented 8 years ago

This zendesk issue also affects changing the language.

Regarding the language: there appears to be a bug where the "script path" is derived.. The inspector shows a file not found for an alternate language, like fr, and it's clearly looking in the wrong place. Setting the script_path option specifically in the options argument corrects the problem in local development.

For a deployment against production code, this fix could be used with options like this:

var storymap = new VCO.StoryMap('data.json',
  { 'script_path': 'https://cdn.knightlab.com/libs/storymapjs/latest/js', 
    'language': 'fr'
  });

This would probably also address changing the font to use an approved font option, since the font CSS files are loaded using a similar mechanism, although I didn't test that out.

I can't see why it would impact the map type.

JoeGermuska commented 8 years ago

Ah, upon further review, for the so-called "advanced" method, fonts are loaded directly with link tags, such as <link rel="stylesheet" href="https://cdn.knightlab.com/libs/storymapjs/latest/css/fonts/font.clicker-garamond.css"> . We should probably rationalize this, but for now, this is a workaround.