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

Tool: Leaflet.js #29

Open
AmeliaBR opened this issue May 24, 2019 · 6 comments
Open

Tool: Leaflet.js #29

AmeliaBR opened this issue May 24, 2019 · 6 comments
Labels
discussion: sample JS tool an existing web map tool: should we include it in the review? what should we say about it? section: reference tools The "Reviewed JavaScript Tools" overview section status: editor's draft there's a draft section in the report that corresponds to this discussion

Comments

@AmeliaBR
Copy link
Member

@AmeliaBR AmeliaBR commented May 24, 2019

This issue is for discussion of the reference tool "Leaflet.js API".


overview and docs

Placeholder for discussing issues about Leaflet as an example in the review. One issue with leaflet is that it is very open-ended. I'm planning to focus on the simplest examples / capabilities that you get out of the box.

@AmeliaBR AmeliaBR added discussion: sample JS tool an existing web map tool: should we include it in the review? what should we say about it? status: editor's draft there's a draft section in the report that corresponds to this discussion labels May 24, 2019
@prushforth
Copy link
Member

@prushforth prushforth commented May 24, 2019

Open ended is good, right? That's progressive enhancement's goal, after all. But, I agree with your approach of taking the least common denominator. I believe this was central to the goal of Leaflet itself, and it's why I built my polyfill with it in the first place. Would be awesome if @IvanSanchez or @mourner could help us visualize a decent API for the eventual (proposed) <map> and <layer> DOM.

@AmeliaBR AmeliaBR added the section: reference tools The "Reviewed JavaScript Tools" overview section label May 26, 2019
@nchan0154
Copy link
Contributor

@nchan0154 nchan0154 commented Jul 1, 2019

Capabilities review for Leaflet is as follows. For several items, the actual Leaflet.js library does not support the capability on it's own, but there some popularopen source/plugins that can be used to perform that capability that are built specifically for Leaflet. What level of support do you think this constitutes as? @AmeliaBR

4.3.1.1 Generate a default map for a given area

Full support.

4.3.1.2 Display a map using a single custom image as a map layer

Supported, option to use WMS services as a tile layer, or a single large image.

4.3.1.3 Display a map using tile data from an author-specified web map service

Supported, this is the default behavior for Leaflet as it does not provide its own tiles.

4.3.1.4 Display a basic map without JavaScript

No support, as Leaflet is a JS library.

4.3.2.1 Show pinpoint locations or custom markers on the map

Full support for multiple markers.

4.3.2.2 Draw polygons or polylines as stylable, interactive vector graphics (separate from the image tiles)

Full support for both Polylines and Polygon vector layers.

4.3.2.3 Support hyperlinks from markers or vector features

Full support, markers or other vector featuers can have popups bound to them. These popups can contain custom HTML content, include hyperlinks.

4.3.2.4 Display map data attribution and links

Full support. Since map tiles do not come with the library, you need to pass this in as an option.

4.3.3.1 Select map view from latitude and longitude point

Full support, this is the default way to select a map view for Leaflet.

4.3.3.2 Select map view from street address or place name

No geocoders are within the actual library, but there are several plugins that offer this functionality.

4.3.3.3 Display map tiles defined in various common coordinate systems

Leaflet comes with three projections out of the box, Equirectangular, Elliptical Mercator and Spherical Mercator (AKA Web Mercator). Web Mercator is the default projection. The Proj4Leaflet library allows for other projections to be used.

4.3.3.4 Reproject map tile data into a new projection or globe view

Not supported at this moment, you can work around this by reinitializing the map in a different projection.

4.3.3.5 Save the location or export to other application

Supported with limitations? You could create your own control to do this, but it doesn't come as part of the default viewer.

4.3.4.1 Zoom the map independently from the rest of the page

Supported, buttons are keyboard accessible (but with wonky focus styles), you can also press the + and - keys to zoom when the map is focused, but again, no focus styles.

4.3.4.2 Pan the map display

Supported, pannable with arrow keys as well.

4.3.4.3 Load additional map tiles when they pan into view

Supported.

4.3.4.4 Wrap/duplicate data tiles when panning around the globe

Supported.

4.3.4.5 Maintain reasonable scale of labels and lines when zooming

This is going to depend on your tiles, but supported with OSM.

4.3.4.6 Dynamically load different resolution map tile on zoom

Supported.

4.3.4.7 Hide or show (and maybe dynamically load) vector features and labels on zoom

Supported, but depends on your tiles.

4.3.5.1 Apply custom styling to map markers and vector features

Full support, map features can be styled using syntax similar to SVG path attributes. Map markers can have custom icons.

4.3.5.2 Apply custom styling to map controls

Supported, you can edit some basic things such as positioning with JS, or you can customize the controls further with CSS.

4.3.5.3 Toggle whether default controls are displayed

Supported, you can hide controls as part of the initial configuration object.

@nchan0154
Copy link
Contributor

@nchan0154 nchan0154 commented Jul 8, 2019

Sorry, just bumping this to get your eyes on this again! @AmeliaBR (and @prushforth if you'd like to weigh in), any opinions on what level of support Leaflet should be categorized as having if a capability is not supported the core Leaflet.js library, but there are open source plugins that provide support for that capability?

@prushforth
Copy link
Member

@prushforth prushforth commented Jul 8, 2019

I'm in the full support camp YMMV!

@AmeliaBR
Copy link
Member Author

@AmeliaBR AmeliaBR commented Jul 8, 2019

I'd consider that a "support, with limitations" if you need to install something extra. Either way, make sure the notes clearly state that a plugin is required.

@AmeliaBR
Copy link
Member Author

@AmeliaBR AmeliaBR commented Jul 8, 2019

Save the location or export to other application

Supported with limitations? You could create your own control to do this, but it doesn't come as part of the default viewer.

This is an end-user use case, so I wouldn't consider it supported unless it is supported by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion: sample JS tool an existing web map tool: should we include it in the review? what should we say about it? section: reference tools The "Reviewed JavaScript Tools" overview section status: editor's draft there's a draft section in the report that corresponds to this discussion
Projects
None yet
Development

No branches or pull requests

3 participants