GithubHelp home page GithubHelp logo

mapbox-components's Introduction

Mapbox Components

A Project to contain and document reusable Mapbox components.

Dependencies

Getting started

  • From the project root, run yarn to get dependancies from NPM.
  • Run gulp watch or npm start to start the project.
  • This will start on localhost:3000 and automatically reload when any changes are made using BrowserSync.

Structure

This project provides a platform on which to build with Mapbox in components to promote reuse. It uses:

  • Gulp, to run our build tasks.
  • Browserify, to allow us to write our JavaScript in components and require Mapbox (or any other libraries) directly.
  • SASS, with Autoprefixer to allow us to write CSS in pre-processed components using ITCSS.
  • Sourcemaps, so we can see see which component a line of JavaScript or CSS comes from when debugging.

Adding components

  • Create independent view(s) (in src/views), JavaScript (in src/js/components) and SASS (in src/sass/components).
  • When using the _file-header.hbs partial, pass a bodyClass parameter to add a class name to the body, then use this class name to override CSS on the body tag in _base.scs.
  • Add comments to all JavaScript that uses the Mapbox API, and any vanilla javaScript or SASS/CSS that may need some explanation.
  • Name files consistently so it's clear which module they belong to.
  • Add a link to the component with a description to the project index including any code used that should be noted.
  • Add the components to this readme.

Updating components

If it's necessary to add to or amend a component to make it work for your project, update the component in this repo where appropriate.

It may be necessary to revisit components as browser support requirements change and ES6 and new CSS features can be used more freely.

Components

See index.html for a full list of components and associated notes.

mapbox-components's People

Contributors

alanshortis avatar

Watchers

James Cloos avatar Philip Van Krimpen avatar  avatar

mapbox-components's Issues

Refactor mapbox css into our own format

It's necessary to include the mapbox CSS to properly display the map. This means we occasionally need to use !important in our own CSS to override behaviour.

Go over the mapbox CSS and refactor into our own version that works better with our own code.

Note: mapbox uses a lot of inline CSS updated by JavaScript so it's unlikely we'll be able to totally avoid nasty overrides.

Update Story Map to use GeoJSON for narrative

The narrative text on the Story Map example is currently hard coded. Update so this is pulled from the GeoJSON along with the map data.

In MOAS, the intention is to create a WordPress REST API custom end point that will return GeoJOSN from a custom post type using advanced custom fields.

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.