Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bower World File Doesn't Load Map #107

Closed
jasonhargrove opened this issue Jun 20, 2014 · 4 comments
Closed

Bower World File Doesn't Load Map #107

jasonhargrove opened this issue Jun 20, 2014 · 4 comments

Comments

@jasonhargrove
Copy link

Installed datamaps via bower and loaded up the files as described in your "getting started" example; the map object is created but the visuals do not load.

Loading it using the world file downloaded from your site landing page works as expected.

@markmarkoh
Copy link
Owner

How are you referencing the bower file? I just tired this and it works as expected.

I did a bower install datamaps

Then created a file called index.html with the following contents:

<!DOCTYPE html>
<html>
<head>
  <style>
    .active { fill: blue !important;}
          /*.datamaps-key dt, .datamaps-key dd {float: none !important;}
          .datamaps-key {right: -50px; top: 0;}*/
        </style>
      </head>
      <body>

        <div id="container1" style="border:1px dotted blue; width: 700px; height: 475px; position: relative;"></div>
        <script src="/bower_components/datamaps/src/js/components/d3/d3.min.js"></script>
        <script src="/bower_components/datamaps/src/js/components/topojson/topojson.js"></script>
        <!-- <script src="/src/js/json2.js"></script> -->
        <script src="/bower_components/datamaps/dist/datamaps.world.js"></script>
        <script>

          var election = new Datamap({
            scope: 'world',
            element: document.getElementById('container1'),
            geographyConfig: {
              popupOnHover: false,
              highlightOnHover: false,
              borderColor: '#444',
              borderWidth: 0.5
            },
            data: {
              USA: {
                fillKey: 'neato'
              }
            },
            fills: {
              'Visited': '#306596',
              'neato': '#0fa0fa',
              'Trouble': '#bada55',
              defaultFill: '#dddddd'
            }
          });
</script>
</body>
</html>

And everything runs correctly. Could it be a src attribute issue you are having?

@markmarkoh
Copy link
Owner

Double check you are referencing a file in the dist directory and not the src/js/datamaps.js file, which is unbuilt (contains no GeoJSON).

@markmarkoh
Copy link
Owner

Closing until I can get some more info

@BrianMitchL
Copy link

This could have been related to #113 It's been almost a year now though, so who knows 😝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants