Tool: Leaflet.js #29
This issue is for discussion of the reference tool "Leaflet.js API".
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.
The text was updated successfully, but these errors were encountered:
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)
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
18.104.22.168 Generate a default map for a given area
22.214.171.124 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.
126.96.36.199 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.
No support, as Leaflet is a JS library.
188.8.131.52 Show pinpoint locations or custom markers on the map
Full support for multiple markers.
184.108.40.206 Draw polygons or polylines as stylable, interactive vector graphics (separate from the image tiles)
220.127.116.11 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.
18.104.22.168 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.
22.214.171.124 Select map view from latitude and longitude point
Full support, this is the default way to select a map view for Leaflet.
126.96.36.199 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.
188.8.131.52 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.
184.108.40.206 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.
220.127.116.11 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.
18.104.22.168 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.
22.214.171.124 Pan the map display
Supported, pannable with arrow keys as well.
126.96.36.199 Load additional map tiles when they pan into view
188.8.131.52 Wrap/duplicate data tiles when panning around the globe
184.108.40.206 Maintain reasonable scale of labels and lines when zooming
This is going to depend on your tiles, but supported with OSM.
220.127.116.11 Dynamically load different resolution map tile on zoom
18.104.22.168 Hide or show (and maybe dynamically load) vector features and labels on zoom
Supported, but depends on your tiles.
22.214.171.124 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.
126.96.36.199 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.
188.8.131.52 Toggle whether default controls are displayed
Supported, you can hide controls as part of the initial configuration object.
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?
This is an end-user use case, so I wouldn't consider it supported unless it is supported by default.