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

Contributions Page Map #720

Merged
merged 9 commits into from
Sep 23, 2020
Merged

Contributions Page Map #720

merged 9 commits into from
Sep 23, 2020

Conversation

danielmmack
Copy link
Collaborator

@danielmmack danielmmack commented Sep 22, 2020

Screen Shot 2020-09-23 at 11 35 13 AM

This PR adds a map button and map to the Contributions page.

References
707

@danielmmack
Copy link
Collaborator Author

danielmmack commented Sep 22, 2020

@exbinary @maebeale

Just some follow up questions:

  • What do you guys think of the style of the map? Is there a preference or a default style that you guys had in mind?

  • Is there a better place to put the style tag that's on line 64 in the MapBrowser.vue file or is it's current location okay?

Copy link
Collaborator

@solebared solebared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So sweet! 🔥 . Some comments inline, but looking amazing 🙌🏾.

Comment on lines +64 to +69
<style>
#map {
width: 100%;
height: 500px;
}
</style>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great location for these styles. I don't see the #map element in the markup here, i assume that brought in by the mapbox element?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's referenced from the mapbox module

<template>
<section class="MapBrowser">
<mapbox
access-token="pk.eyJ1IjoibXV0dWFsLWFpZC1hcHAiLCJhIjoiY2tmZTBvd3UwMDBhbTJ4cDlic2JmMWZoaiJ9.rWscBjdl1SMT5N0yekIJYg"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably want to pull this in via an environment variable.

That'll require reading that on the server and making it available to the front end, which we don't currently have an example of (well, we have examples of getting page data into vue, but i suspect we'll want a slightly different scheme for globals such as this).

I'm ok with punting on that for now. Would you mind leaving a FIXME comment in there so we come back to it (one day!).

<mapbox
access-token="pk.eyJ1IjoibXV0dWFsLWFpZC1hcHAiLCJhIjoiY2tmZTBvd3UwMDBhbTJ4cDlic2JmMWZoaiJ9.rWscBjdl1SMT5N0yekIJYg"
:map-options="{
style: 'mapbox://styles/mapbox/streets-v11',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong preference for one style over another. For reference, i found this list:
https://docs.mapbox.com/api/maps/#mapbox-styles
Of those, i'd be good with streets, light, satellite-streets.
Curious if others have preferences. Also easy to change, so happy to go with your suggestion.

@@ -4,6 +4,7 @@
<%= csp_meta_tag %>

<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src='https://api.mapbox.com/mapbox-gl-js/v1.12.0/mapbox-gl.js'></script>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are obviously tradeoffs in both directions, but there's also the option of packaging this up with webpack:
https://docs.mapbox.com/mapbox-gl-js/api/ and https://docs.mapbox.com/mapbox-gl-js/api/#mapbox-css.

I'm good with using the cdn for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can circle back to this. we first tried adding it via webpack but we encountered problems.

</template>

<script>
import Mapbox from 'mapbox-gl-vue'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks for finding a vue wrapper!

Copy link
Collaborator

@eabousaif eabousaif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@phylum phylum merged commit 3785b30 into main Sep 23, 2020
@phylum phylum deleted the feature/mapbox branch September 23, 2020 15:36
@solebared solebared linked an issue Sep 29, 2020 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Implement Map on Contributions Page
6 participants