Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

Leaflet component #2

Open
DingoEatingFuzz opened this issue Jan 26, 2017 · 14 comments
Open

Leaflet component #2

DingoEatingFuzz opened this issue Jan 26, 2017 · 14 comments

Comments

@DingoEatingFuzz
Copy link
Contributor

DingoEatingFuzz commented Jan 26, 2017

The housing team needs a component that takes geojson and renders a leaflet map.

We'll be building this, but I wanted to make an issue first to make sure we aren't duplicating effort across teams!

Ultimately it will fit into a page that looks like this:

image

So you can expect it to require geojson and provide hover and click events for points and regions.

@DavideDaniel
Copy link
Contributor

How about using https://github.com/PaulLeCam/react-leaflet and working on the tooltip part?

@keirstaple
Copy link

Documentation on how to create a tooltip component: https://github.com/PaulLeCam/react-leaflet/blob/master/docs/Components.md#tooltip
Points you to the Leaflet documentation: http://leafletjs.com/reference-1.0.0.html#tooltip

@dsdemaria
Copy link
Contributor

Tonight is a presentation on using leaflet.
https://www.civiclabpdx.com/platform-design-time-1-1-1-1-1

The presentation will cover using transportation team data to build out a map, so for now this seems like the best option to head in.

@joehand
Copy link

joehand commented Feb 7, 2017

In addition to the leaflet component, having a component for displaying geojson data would be sweet. I'd used this before which allows you to pass in random geojson data to display on a leaflet map and would be happy to add that here.

I'll be hacking on this tonight with the transportation team!

@dsdemaria
Copy link
Contributor

screen shot 2017-03-14 at 6 37 59 pm

Housing has updated needs for the map component. The map will include two 'layers' represented by data from the user and a list of demographics. The layers will overlap to show where the user and a selected demographic can live.

@clemf
Copy link

clemf commented Mar 26, 2017

I'm taking a stab at this and noticed this in the react-leaflet docs:

Leaflet makes direct calls to the DOM when it is loaded, therefore this library is not compatible with server-side rendering.

Also, see this issue for more discussion on the topic: PaulLeCam/react-leaflet#45

@DavideDaniel Do we need the map component to be compatible with server-side rendering?

@jaronheard
Copy link
Contributor

I'm working on a component that will display geoJSON on top of the leaflet component. I started by copying the existing leafletMap component.

@jaronheard
Copy link
Contributor

This may be a solution to the server-side rendering issue earlier, it essentially just forces the map to render client-side.
https://github.com/masotime/react-leaflet-universal

@jaronheard
Copy link
Contributor

Listening to @DavideDaniel on Leaflet and server-side rendering, I don't think the server-side rendering thing on this module is going to be an issue. AKA he is a man with a plan.

@DavideDaniel
Copy link
Contributor

DavideDaniel commented Apr 9, 2017 via email

@jaronheard
Copy link
Contributor

@dsdemaria Researched options to show pattern layers on a map using react-leaflet, as shown in the housing team design above. I don’t think there is an existing solution for this. There is a plugin for leaflet (https://github.com/teastman/Leaflet.pattern), but in order to use with react-leaflet, it will need to be adapted. I’m going to work on an extension to react-leaflet that would allow shading to be visualized based on Leaflet.pattern.

@clemf
Copy link

clemf commented Apr 15, 2017

@jaronheard Your StamenMap component is awesome, but maybe we should merge it with the LeafletMap component. It seems to me it would make more sense for the different tileset and added layer to be set via prop instead of being a new component.

@jaronheard
Copy link
Contributor

@clemf I totally agree. I was thinking the same thing myself. I could merge in my examples to LeafletMap, as those were the only things that were really useful about StamenMap - besides potentially the additional import of GeoJSON from react-leaflet. I'll try to get a PR submitted this week.

Only other worry was if people had started using StamenMap they may have to change their code slightly. But I can give a heads up on the x-frontend Slack channel if we implement this.

@jaronheard
Copy link
Contributor

jaronheard commented Apr 24, 2017

@clemf #72 is the merge you suggested above.

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

No branches or pull requests

7 participants