GithubHelp home page GithubHelp logo

fgpv-vpgf / fgpv-vpgf Goto Github PK

View Code? Open in Web Editor NEW
43.0 25.0 48.0 109.63 MB

The Reusable Accessible Mapping Platform (RAMP), also known as the Federal Geospatial Platform Visualiser (FGPV), is a Javascript based web mapping platform that provides a reusable, responsive and WCAG 2.0 "AA" compliant common viewer platform for the Government of Canada.

Home Page: https://fgpv-vpgf.github.io/fgpv-vpgf/develop/docs/#/

License: Other

JavaScript 67.97% HTML 8.43% CSS 2.29% Shell 0.06% XSLT 0.21% Smarty 5.18% TypeScript 8.46% CoffeeScript 0.06% Handlebars 0.58% SCSS 6.76%
web-mapping geospatial geo esri-javascript-api wcag-aa

fgpv-vpgf's Introduction

RAMP2 FGP Visualiser / Visualisateur pour la PGF PCAR2

The Reusable Accessible Mapping Platform (RAMP), also known as the Federal Geospatial Platform Visualiser (FGPV), is a Javascript based web mapping platform that provides a reusable, responsive and WCAG 2.0 "AA" compliant common viewer platform for the Government of Canada.

This is an unsupported product. If you require a supported version please contact [email protected] for a cost estimate. The software and code samples available on this website are provided "as is" without warranty of any kind, either express or implied. Use at your own risk. Access to this GitHub repository could become unavailable at any point in time.

This project is now a monorepo and contains the following repos under the packages folder:

Building the project

Install Python 2 if you don't already have it: Python 2.7.18 Download (Python 3 is not supported)

Install the required C++ build tools (2 options)

Install Rush if you don't already have it:

$ npm install -g @microsoft/rush

Clone the repo and use Rush to install dependencies

$ rush update

You might want to run rush update -p --full to cleanly re-install all the dependencies (-p will purge what is currently there)

Build the project:

$ rush build
  • NOTE: rush build will need to be run before the rush serve statement below any time code is changed in ramp-geoapi to avoid an outdated build

Serve the project:

$ rush serve -p 10 -v
  • -p 10 specifies the maximum number of concurrent processes to run (we need 8 right now to serve all the packages at the same time)
  • -v provides verbose output for debugging

If you want to work on only a subset of packages instead you have to run their builds/serves seperately:

// terminal 0
$ cd packages/ramp-core
$ npm run serve

// terminal 1
$ cd packages/ramp-plugin-enhanced-table
$ npm run serve

Lastly open the samples page:

http://localhost:6001/samples/index-samples.html
etc.

For more rush commands or general reading: https://rushjs.io/pages/intro/welcome/

For more info on individual packages builds/documentation read the READMEs in the respective folder.

Documentation

For more information on this project, please see one of the sections below:

Also, please visit the Documentation Site for additional content on:

Usage

Quick guide

We'll go through the simplest way to use RAMP, for more information see the map author guide

First, grab the most recent release from the github releases Place the files rv-main.js and rv-styles.css within your webpage's folder structure. We usually put our JavaScript files under a js folder and our stylesheets under a css folder.

Then you want to include those files on your page, along with jQuery and the needed polyfills:

  1. Within head
<link rel="stylesheet" href="../../../rv-styles.css" />
  1. Near the end of the body
<script
  src="https://code.jquery.com/jquery-2.2.4.min.js"
  integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
  crossorigin="anonymous"
></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,Object.entries,Object.values,Array.prototype.find,Array.prototype.findIndex,Array.prototype.values,Array.prototype.includes,HTMLCanvasElement.prototype.toBlob,String.prototype.repeat,String.prototype.codePointAt,String.fromCodePoint,NodeList.prototype.@@iterator,Promise,Promise.prototype.finally"></script>
<script src="/js/rv-main.js"></script>

Now that you have the required files on your page we should add the map element.

<div
  is="rv-map"
  style="height: 100%; display:flex;"
  rv-langs='["en-CA", "fr-CA"]'
></div>

A map should now load on your page. Theres much more you can do with RAMP, a good place to start is the map author guide

Samples

A collection of sample source files are in the repo.

A live site containing our development sample page is found here.

An example of a production site is the Government of Canada Climate Data Viewer.

Support

Bugs

If you have a bug to report you can open up an issue at https://github.com/fgpv-vpgf/fgpv-vpgf/issues by clicking the green button above the issue list

For more information on contributing read the Contributing Guide. Note there may be some references to the pre-monorepo setup, pull requests are now only needed in one place (this repo).

Contact

The team can be reached at [email protected]

Next Version

RAMP 4 has put out its initial release. Notable changes include:

  • Updating the UI framework from Angular 1 to Vue 3
  • Updating the ESRI Mapping API from v3 to v4
  • An application architecture and API that is more open and adjustable
  • UI re-design with mobile use in mind

The release notes cover the differences, breaking changes, and feature gaps between this version and RAMP 4.

fgpv-vpgf's People

Contributors

aleksueir avatar alexandreleroux avatar alyec avatar alymerchant avatar barryytm avatar bchagnon avatar chrislatrncan avatar cynngah avatar dan-bowerman avatar dane-thomas avatar gitter-badger avatar glitch-bot avatar jahidahmed avatar james-rae avatar jolevesq avatar milespetrov avatar ryancoulsonca avatar sharvenp avatar sofeel avatar spencerwahl avatar yileifeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fgpv-vpgf's Issues

Incorporate gulp-i18n-csv into the build process

Wait for gulp-i18n-csv 1.1.0 release.

Create locales.csv file in src/locales with two languages (en, fr), fill it with whatever strings are used in the code base at the moment, use gulp-i18n-csv to break it into en-CA/translation.json and fr-CA/translation.json files in src/locales.

UI-router "Replacement" !important

After working for some time with the ui-router, I think it's not entirely suitable for our purposes because it uses a tree-like structure to describe routes with a single root state.

Say we have three panels which can be either open or closed: mainPanel, sidePanel, and filterPanel. And we create the following routes (app is an abstract root state):

"app.main": mainPanel is open
"app.main.side": mainPanel and its sidePanel is open
"app.main.side.filter": all three panels are open
"app.main.filter": mainPanel and filterPanel
"app.filter": filterPanel is open

Problems start when you want to go from "app.main.filter" to "app.filter" by closing the mainPanel but keeping the filterPanel open. When switching between states, ui-router clears views populated by the current state leaving views populated by the parent states intact. So, switching to "app.filter" will first remove filterPanel from the dom and then re-insert it back.

View's HTML structure is not cached and will be reinitialized upon insertion which may involve a lot of calculations (removing and re-inserting a large datatable for example). Even worse, when the view is cleared, its leave animation is triggered; on re-insertion, its enter animation. We want the filterPanel to stay put, not animate in and out when closing the mainPanel.

Four possible ways around it:

  1. Drop animations for enter/leave transitions. We might still get flickering when components removed/re-inserted into the dom.
  2. Create a separate route for all possible combinations of components: "app.main.filter.nomain" for closing the mainPanel when the filterPanel stays open for example. I fear this can get ridiculous in a jiffy.
  3. Write a simple, custom state manager which let us control component's state independently of each other.
  4. Wait until the new angular router comes out with Angular 1.5 as it seems to solve this problem.

Sync JSCS rules with geoApi

The geoApi repo got some extra JSCS rules enabled, this is a reminder to sync the new stuff at some point.

feat(ui): add keyboard based map navigation

Keyboard driven pan and zoom should be enabled for accessibility. Allowing users to tab through to the navigation panel does not count. Need to wait until some tab order issues are sorted out.

Replace CSS animations with JS

Turned out CSS animations are not enough for the transitions we want to have. Will need to replace them with JS-based animation (GSAP or Popmotion or something else entirely).

Getting more done in GitHub with ZenHub

Hola! @AleksueiR has created a ZenHub account for the fgpv-vpgf organization. ZenHub is the leading team collaboration and project management solution built for GitHub.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • “+1” button for GitHub issues and comments;
  • Drag-and-drop file sharing;
  • Time-saving shortcuts like a quick repo switcher.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @AleksueiR.

ZenHub Board

Mobile Layout

This will mainly address responsive layout changes which apply to mobile devices.

Material Design suggest seven breakpoint widths to adapt to. We are going to use two: 480 and 840dp.

Small (a phone or a small tablet): 0 - 480

Up to 480dp, the main panel housing the legend can take up the whole width of the page, look nice and no produce too much wasted white space.

  • each panel occupies the whole screen
    • child panels should display a back arrow instead of the close button in the top-left corner when overlaying their parent panels.
  • datapanel is always maximized
    • split view is removed
    • row/column spacing can be adjusted to allow for more information to be shown in it
  • Overview map is removed to free up space
  • 10px gutter around panels can be removed to free up move space
Main view Legend Layer Import
Settings Datapanel Details (opend from datapanel)
Details (opened from map)

Medium (a big phone or a tablet): 480 - 840

At this size, the main panel will create lots of unused white space if it were to take the full width of the page. In this layout, all panels except the datapanel will remain their default width (350dp).

  • child panels should display a back arrow instead of the close button in the top-left corner when overlaying their parent panels.
  • datapanel takes takes the full width of the page
    • split view is removed
    • row/column spacing can be adjusted to allow for more information to be shown in it
    • point details panel originated from the datatable opens as an "expanded" popup
  • Overview map is removed to free up space
  • 10px gutter around panels can be removed to free up move space
Main view Legend Settings
Datapanel Details (opened from datapanel) Details (opened from map)
Details (opened from map; expaned view)

Large (everything larger): 840 - ∞

Done, thanks!

Material Design suggests three options for growing the layout beyond 1600dp:

  • Become center aligned with increased margins
  • Remain left aligned while the right margin grows
  • Continue to grow while revealing additional content

Other consideration for mobile support:

  • remove zoom in/out controls if touch support is detected (needs Mike's approval) (what if it's a laptop with a touch screen, do we still want to remove zoom controls?)
  • provide a safeguard or a user warning when downloading large amounts of data on a mobile device (applies to all layouts)
  • enlarge small icons (legend entry flags) and/or increase spacing around them to make tapping them easier (applies to all layouts)

Other notes:

  • Hover tooltips can't be shown on hover on touch-only devices (for obvious reasons), but they do display on single tap and long press. This is useful for things like legend entry flags (type, user-added, etc.). Not so for for actionable controls - they will activate on both actions. Need to prevent controls from activating on long presses (which still should display a tooltip).
  • Angular Dragula seem to start the drag on the long press as well when touch events are detected.

Task List:

  • add mobile browser detection script
  • update styles to include selected breakpoints (need to research ways to do it)
  • small and medium layout: remove overview map
  • touch mode: enlarge small icons (legend entry flags) and/or increase spacing around them to make tapping them easier (applies to all layouts)
  • touch mode: prevent controls from activating on long presses (which still should display a tooltip).
  • change basemap selector to a side navigation component
  • small layout: update panels to occupy the whole screen
  • small and medium layout: add back arrows instead of the close buttons in the top-left corner to child panels when overlaying their parent panels.
  • small and medium layout: remove split view from datatable
  • small and medium layout: datatable is maximized by default
  • small layout: adjust row/column spacing to allow for more data to be visible
  • medium layout: update details panel opened from the datatable to open as an "expended" popup
  • touch mode[needs decision]: enable drag handles on legend entries
  • more...

feat(ui): enable nav buttons

Nav buttons are currently decorative. As soon as the geo module / geoapi is more developed add some functionality for navigation.

feat(ui): display notification for broken basemaps

If technically possible, it would be helpful to display a notification in the basemap selector that a particular basemap is broken and won't load. It might even make more sense to completely remove broken basemaps from the selector list.

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.