Code Monkey home page Code Monkey logo

storymap's Issues

wish: support iframe backgrounds

It would be nice to support interactive maps embedded as section backgrounds that are hosted elsewhere.

Perhaps these could be implemented with <section data-iframe="https://some-map-url-to-embed.com"> and then about there in the code, support could be for them as section backgrounds:

$.each(sections, function (key, element) {

For example, a lot of Esri / ArcGIS Online maps allow iframe embedding.

Unrelated section tag breaks 'home button'

Hi @jakobzhao, thx for your nice library!

Having used it recently in a little example, we were having problems with 'home button' not working fine. We checked the code and the problem is this function:

$('.storymap-scroll-down').click(function () {
  var viewing = $(".viewing");
  if (viewing.data("scene") !== $("section:last").data("scene")) {
    if (nav.length !== 0) {
      window.scrollBy(0, viewing.offset().top + viewing.height() - $(window).scrollTop() - $('.storymap-navbar').height() - 10);
    } else {
      window.scrollBy(0, viewing.offset().top + viewing.height() - $(window).scrollTop() - 10);
    }
  } else {
    window.scrollTo(0, 0);
  }
}); 

As you can see, there is a DOM selector like $("section:last").data("scene")), and in our web page we had another, unrelated 'section' tag (without any 'scene' attribute), so that broke the 'if' when returning undefined.

IMO it should be enough to just replace it with $("section[data-scene]:last").data('scene') to fix it.

Thx!


PD We were using https://cdn.rawgit.com/jakobzhao/storymap/master/dist/storymap.2.4.js

Scene Alias

It would be nice if the official 'scene-name' didn't show in the navbar. Is there a way to create an alias?

divIcon seems don't work

Hi, and thank you for this awesome library. I'm trying to add divIcon on a map, but it seems that not working.

onEachFeature: function (feature, layer) {
   return L.marker([feature.properties.labelx, feature.properties.labely], {icon: L.divIcon({
       className: 'labelDiocese', 
       html: feature.properties.nom
   })});
}

I've no error on my console, but div not appear. Is it storymap configuration or me ?

layers variable leaks out to global scope

Looks like layers isn't declared within the storymap.2.5.js script. Can be fixed by passing layers as a setting to the map:

$('#storymap').storymap({
        layers: layers,
        scenes: scenes,

And then accessing like so within storymap.2.5.js (line 292):

$.each(settings.layers, function (key, layer) {

    // layer = layer.layer;
    layer.layer.on('s');
    layer.layer.on('load', function () {
        $(".storymap-loader").fadeTo(1000, 0);
    })

});```

Top arrow?

Right now there is only a bottom arrow on each page. I think a top arrow (to return to the previous section) would be useful as well.

Thank you!

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.