Copyright © 2019-2021 the Contributors to the Use Cases and Requirements for Standardizing Web Maps Specification, published by the Maps For HTML Community Group under the W3C Community Contributor License Agreement (CLA). A human-readable summary is available.
This report outlines the use cases and requirements for standardizing modern Web maps, in a way that works for map content authors, webpage authors, and website users. The use cases and requirements were gathered in consultation with the Maps for HTML Community Group and others.
Three aspects of web maps are reviewed: map viewer widgets, client-side mapping APIs, and map data formats. For each, evidence is gathered from widely-used scripted JavaScript web map frameworks. The common features and limitations of the current techniques are the basis of the requirements for a standardized solution that could be built in to HTML and web browsers.
This specification was published by the Maps For HTML Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.
Comments, corrections, and suggested additions should be made as GitHub issues. If that is not possible, send an email comment to public-maps4html@w3.org.
GitHub Issues are preferred for discussion of this specification.
Web maps today are indispensable to billions of people, for exploring and understanding the world around them. Like paper maps before them, web maps are used for planning, wayfinding, analysis, and more. But the power of an interactive, hyperlinked medium supports a richer experience than could have been imagined by a cartographer from a previous century. Online maps can be dynamically redrawn with new data, or according to the user's preferences. They can connect to other maps — for adjacent areas, finer detail, or different geographical features — and can link out to complex information about the places they represent.
But despite their ubiquity on the web, maps have no native, semantic representation in HTML.
HTML has had “image maps” —
hyperlinked graphics, where selecting different parts of the graphic triggers a different URL —
from its early days.
These were quickly adopted to
represent simple cartographic maps.
The <MAP>
element
sounds like it should be the basis of a web map,
but its basic functionality
(to define geometric areas on an image that represent distinct hyperlinks)
has not evolved to include many capabilities
that users today expect when interacting with maps on the web,
such as the ability to dynamically change the map view.
Web mapping technology has undergone a long period of evolution. Today's web maps are usually sophisticated client-server applications, dynamically combining many types of spatial data on demand for web users. Implementations vary widely, but some of the underlying techniques, software, semantics and formats have become accepted patterns (for example, the tile naming systems), or formal standards (for example, the standards published by the Open Geospatial Consortium, some of which are also ISO standards).
Many sources of spatial data are available online, from governments, commercial services, and non-profit projects. But accessing and using the data is a specialized task; most web developers or website content creators rely on JavaScript frameworks (or sometimes still Flash frameworks) that can fetch the correct map image tiles or vector data, draw them to the screen, and handle the most common user interactions.
Many of these web map frameworks are tied to a specific commercial provider of map data, making it difficult for website creators to integrate their own data, or data from multiple sources. Many of the web map frameworks do not work at all without JavaScript, and require considerable resource downloads and processing. The end user has limited control or customization over the map interface — unless the website author happened to choose the web map provider that matches the native mapping application on the end-user's device.
Web maps today may not be perfect, but they have filled a clear need for website authors and users. The multiple frameworks used to generate web maps implement the same capabilities with different code — code that needs to be downloaded and processed for each website with a map in it. These core aspects of Web maps represent mature, ubiquitous user interface (UI) and application programming interface (API) patterns. It is now reasonable to consider standardizing these capabilities for implementation by web browsers directly.
A key challenge is to do so in a way that is compatible with the core values of the open web, and integrated with other web platform technologies.
The Maps For HTML Community Group (Maps4HTML) arose as a result of face-to-face discussions at the Linking Geospatial Data workshop 2014, co-sponsored by the W3C and the Open Geospatial Consortium.
The group operates within the structure of a W3C community group, with clear license terms for contributions of intellectual property. The community group process designed to support the eventual transition of the group's work to become open web standards. The group attempts to follow the established best practices for web standard development, as outlined in the guiding principles for this report.
The initial requirements sketched out at LGD2014 were expanded into an initial use cases and requirements summary. That work was the basis of the draft Map Markup Language (MapML) specification. Although MapML has had notable support and development efforts from within the geospatial community, as of early 2019 it has not received significant support from web browser developers or HTML standards teams. For that reason, the current document rolls back the focus to the discussion of mapping use cases and requirements. The structure of this report is intended to more comprehensively explain why native HTML web maps would be beneficial, and how they should best be defined.
This report is a work in progress! Feedback and contributions are welcome. Most sections of the report include links to a discussion issue on GitHub. Use those issues to suggest corrections, additions, or changes to the conclusions. To suggest a new section (e.g., a new use case), please start a new issue.
To make substantive contributions (that is, anything that is bigger than typo corrections or formatting fixes), you will need to first become a member of the community group and make the corresponding IP commitments.
The purpose of this report is to describe (1) why and how the open web would benefit from having web map features built in to web browsers, and (2) what this native web mapping function should look like, to website creators and to end users.
This report uses an empirical approach to identify required features of web maps, by looking for the common features of web map frameworks used today. However, we also recognize that web maps today have limitations. A proposal for a native HTML web map, built in to web browsers, needs to be assessed on the same merits as any other proposed web standard.
In § 2. Guiding Principles, we outline the theoretical factors we use for assessing whether a given feature should be included as a requirement.
In § 3. Use Cases, we outline common goals for people interacting with web maps. The use cases are defined in pragmatic terms, describing a specific function or action. Real-world, domain-specific applications of the use case are summarized in an introductory description. The use cases are divided according to whether they apply to content creators, website visitors, or web application developers. (Of course, there is overlap between the audiences — good developers want to create good user experiences!)
In § 4. Reviewed JavaScript Tools, we introduce the web map frameworks that are used in the empirical review.
The review of potential requirements is then divided into three parts:
For each category, we list technological capabilities: features, which a web map might include, that could help solve the use cases. Capabilities are potential requirements for a native HTML web map. To assess whether the capability should be a requirement, we examine:
For each capability, we conclude by summarizing its costs and potential benefits (using tags defined in the next section) for integration as a native HTML web map feature. We assign it one of three possible conclusions:
If there is not yet enough evidence for a conclusion, the capability will be marked undecided.
Web mapping and geospatial data have a rich vocabulary that is not always clear to outsiders. This report uses the following terms in the ways defined here, unless another meaning is clearly specified:
The structure of this review is inspired by many other projects that have outlined best practices for web standards developments. This section briefly outlines the principles behind our approach, with links to further reading.
The report uses an evidence-based approach, defining requirements not based on hypothetical use cases but on web map tools that are already in use. We assume that the common features of existing, widely-used web map frameworks represent core functionality that web users and website authors expect from native web maps.
This approach is inspired by The Extensible Web Manifesto which aims to “tighten the feedback loop between the editors of web standards and web developers,” establishing “a clear path for good ideas by web developers to become part of the infrastructure of the web” [EXTENSIBLE].
Much of the manifesto focuses on making it easier for developers to experiment with new features — to expose web platform capabilities at a more granular level, so that developers can remix and extend them to try out new ideas. HTML custom elements and CSS custom properties are just two of many examples of how web standards efforts since 2012 have focused on creating better building blocks for web developers.
But the implicit second step of the extensible web approach is that, once a consensus has developed from real-world experience with particular features or patterns on the web, those features can be standardized with confidence.
Web maps are extremely complex user interfaces. If that complexity is to be built-in to web browsers, the extensible web mindset requires that it be exposed to developers as individual capabilities that can be remixed and extended. For that reason, this review breaks web map functionality into very low-level capabilities. In addition to describing how each capability is used in mapping, we discuss how the same building block could be used for other web content. Focusing on these low-level capabilities also ensures that we do not overlook important details, such as the need to make individual interactions accessible to all users.
To decide whether a capability should or shouldn't be considered a requirement for web maps, we need to assess its benefits and costs. But benefits and costs are subjective: to calculate them, we need a set of values or principles defining best practices for web standards. Only then can we assess whether integrating a feature into web browsers can bring the web closer to our ideals.
Benefits and costs are also different from different perspectives. Integrating web maps into HTML means convincing other web standard editors and web browser developers. But once a web standard is adopted, the number of website authors who use it will (hopefully) be much larger than the number of people who worked on the initial standard; the number of people who use those websites will be larger still. The HTML Design Principles rely on these numbers to establish a “priority of constituencies”:
In case of conflict, consider users over authors over implementors over specifiers over theoretical purity. … Of course, it is preferred to make things better for multiple constituencies at once. [html-design-principles]
This section introduces the categories by which we measure costs and benefits to each of these constituencies.
An inclusive web is available to everyone, to connect and create in the ways most comfortable to them.
In this report, the user-friendliness of a potential web map feature is assessed on these points:
Can this feature be implemented in a privacy-respecting manner? Are there any other security concerns from this feature? Would making it a built-in feature, standardized in web browsers, improve privacy & security compared to current web practice?
Tags for the costs and benefits of potential requirements:
Further information:
Does including this capability in a web map standard make it easier to ensure an accessible experience (assuming an accessibility-focused browser implementation)?
Related tags:
Further information:
Can this feature be implemented in a manner that works for all languages and regions? Does building it into the browser increase the likelihood that internationalization is done correctly?
Related tags:
Further information:
Would building in this feature significantly reduce the amount of data downloaded to the user device, or the amount of custom code that needs to run? Or would it impose heavy computation demands on the user device?
Related tags:
Further information:
Implementers, for a web standard, are the people who build and maintain web browsers and other user agent software. Because much of the work of a web browser is to work as the user's agent, features that are good for the user when it comes to security or performance are also good for implementers. But some implementer benefits aren't directly exposed to the user:
An implementation that already exists is always easier. Could this feature reuse code that is already available to the browser?
Related tags:
The basic use cases for website authors focus on presenting information. Different types of map data require different display capabilities. More advanced geographic application development End users may wish to use that information in ways that go beyond what the website author intended; those use cases are grouped separately.
Users often want more information than is initially visible in a map viewer. The user may zoom out or pan, to help place the displayed location in a larger context. Or they may zoom in, to see details more clearly.
This use case exists regardless of how the user interacts with their device. For it to be fully supported, the map viewer must be explorable with all of the following input methods:
Test out panning and zooming on the basic single-location map views for the reference JavaScript tools.
Discuss this section on GitHub.
It is common for a map viewer to be provided in a web page to show an area relevant to the subject of the page. An encyclopedia might include a map on its page about a battlefield; a city guide might include a map on its page about the central railway station.
When a user interacts with the map, they may end up viewing a location far from the starting point, or with the map at a zoom level which is inconvenient for relating the map view to the primary content of the page.
In such a case it would be useful to provide a mechanism by which the user can reset the map to the original configuration provided by the web page author.
See examples of allowing a user to reset the map to their starting point as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
When following directions on a map, many people find it easier if the map is oriented to the direction they are facing in real life. But rotating a map (intentionally or accidentally), can confuse orientation, too, so it is also useful to have an easy way to reset the map bearing (rotation) to the standard view: with the cardinal directions (North-South and East-West) aligned screen dimensions (top-bottom and left-right).
Test out map rotation on the basic single-location map views for the reference JavaScript tools.
Discuss this section on GitHub.
A map view can't show everything all at once. Users often want to find more information about the representations on the map. This information could be presented as details displayed on demand in a pop-up box or sidebar.
The details that are available might include the coordinates of the point, labels for any features at that point, metadata or links to further information about the features, or local data values for continuous coverage data layers.
Some of this information might require querying the server with the selected coordinates. But to the extent that the information is already available in the map viewer, it should be accessible by users without the author adding extra features.
Discuss this section on GitHub.
A multi-layered map can be overwhelming. Users sometimes want to remove overlays or features that aren't relevant to them. In addition, comparisons between two maps (e.g., for before and after effects) can often be seen more clearly by toggling between two states within the same display.
See examples of allowing a user to show and hide overlays and features as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
Discuss this section on GitHub.
Discuss this section on GitHub.
Discuss this section on GitHub.
Discuss this section on GitHub.
To get a better view of a map, and to ease navigation, a user may want to view the map in fullscreen mode.
Discuss this section on GitHub.
Displaying a map viewer as a Picture-In-Picture (PIP) media object allows for users to navigate to other applications, or a different tab in the browser from which the map viewer is embedded, while still being able to see and interact with the map viewer.
Discuss this section on GitHub.
Discuss this section on GitHub.
Discuss this section on GitHub.
Built-in mapping widgets cannot cover all possible mapping applications. Web application developers need to be able extend and manipulate the viewer, or respond to user interaction with it.
Of course, a script-based mapping application will also usually need scripted control over basic map configuration. The necessary capabilities are listed above, under the relevant content author use cases. A web application author may also wish to implement capabilities for the benefit of the website visitor; again, the required capabilities are included in the visitor use cases.
A control is a user interface component that is integrated with a map. It may provide user feedback about the current state of the map, provide one or more affordances for manipulating the state of the map, or some combination of the two. Typically, controls are integrated into the map display in such a way that no other map content can overlie or obscure them.
Many client APIs allow developers to implement custom controls and add them to a map. The advantage of using a custom control is that it becomes a peer of the native controls provided by the map, and thus acquires any inherent capabilities and behaviours of those controls. For example, if a map provided a way for the user to hide all controls, the custom control would be hidden along with the native controls. This close integration cannot be achieved by a component which is external to the map, and only made to appear as if visually integrated through positioning, without additional work; furthermore, the integration may not be reliable in the long term if it must be achieved by relying on undocumented or underspecified behaviour of the map API.
A web developer may wish to add one or more custom controls to a map so as to provide capabilities that are not available within the standard set of controls provided by the mapping API, or to make up for perceived deficiencies of the provided controls.
For example, a default zoom control may be inaccessible to keyboard users, in which case it could be replaced with an accessible version that utilised a public API to effect zooming in response to the keyboard.
See examples of adding a custom control to a map as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
A web developer may wish to respond to changes such as position and zoom level of a map as it is manipulated by the user, in order to update user interface components containing information related to the map.
For example, an application displaying a list of places of interest in a city might update the list to highlight those places that are within the current extent of the map as the user pans and zooms, or filter the list to only show those items. On a device where the user's current location is known, the distance to the currently-displayed centre of the map, along with an indication of the user's bearing relative to that point, could be shown. If an application is showing a list of items whose associated locations are represented on the map by markers, selecting a marker could highlight the corresponding list item.
See examples of providing feedback to a user as they manipulate the map as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
Complex mapping applications often need to control the displayed map view, independently of the regular user-controlled panning and zooming. The developer's code must be able to move a map to a new position and/or zoom level.
For example, the user may be choosing from a list of locations of interest, and expect the map to adjust to show the current point of interest at the centre. If the items among which the user is choosing are not points but areas, such as administrative regions, then the map may need not only to move but also to adjust its zoom level to one which best fits the area.
See examples of moving a map to a new position and zoom level as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
A web developer implementing the display of a number of locations arranged sequentially may require the ability to cause the map to animate through the locations by panning and zooming.
Examples include traversing through the points that make up a set of directions, or through a set of locations that form part of a temporal sequence.
See examples of animating a map through a sequence of points as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
In addition to user-controlled map rotation, a developer may need to dynamically update the bearing of a map — that is, to rotate the map view so that a direction other than North is at the "top".
Examples include responding to the orientation of a device, traversing a route, and allowing the user to orient themselves with respect to the map by manipulating it with respect to local landmarks.
See examples of changing the bearing of a map as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
See examples of allowing the user to control the layer displayed by a map as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
Many forms of geographical data are available in vector formats, such as shapefiles describing the boundaries of administrative areas and poly lines representing a route. A web developer wishing to display such external data requires an API allowing it to be added as an overlay to the map view.
Display routes/paths or regions covers the use of existing vector data, in standard geographic file formats. However, a web app developer may want to dynamically generate vector shapes from data. For example, to implement a feature allowing users to draw new shapes on the map, the developer needs to convert the selected points into a new polygon feature.
See examples of showing a vector data overlay as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
Heatmaps are a common way of showing the variation of some variable across a geographical area, as the accumulation of intensity created by many point measurements.
From the point of view of the end user, it is a type of coverage data that is displayed as an overlay on a map. However, many mapping frameworks have specialized APIs that can generate heatmap layers directly from the point data, without needing to pre-process it into a raster layer.
See examples of data heatmaps as implemented by the reference JavaScript tools.
Discuss this section on GitHub.
Discuss this section on GitHub.
Numerous options currently exist for a website author who wants to include a map viewer in a web page, with a minimum of custom code. The examples reviewed in this section are used to identify the common features (and limitations) of web map viewers.
Many major commercial providers of web map data tiles provide ready-to-use map viewer widgets for websites to use. In addition, multiple open source JavaScript libraries have developed to make it easier for website authors to build on other map data services.
Need data to back up the reference implementations.
The reviewed implementations come in three forms:
iframe
;
configuration options are set through the URL in src
attribute.
Need to decide on web component examples to use as reference.
With these different structures, comparisons are not always exact. Similar functionality may be generated from very different APIs. We assess first whether a given capability is present in each implementation, and second whether there are common patterns in how that capability is exposed.
For each capability (potential web map feature) that we review, we assign one of the following implementation levels to each of the reference tools:
Compiling and serving map data is a complex, expensive enterprise. Many of the map data and search services require registered developer accounts, with usage-based pricing. This review focuses on features that are free-to-use for website creators, at least for low-traffic websites, or that use data which is available from many interchangeable sources. However, because of the complexities of pricing models used by some services, we don't strictly exclude paid features from our assessment of support.
By far the most frequently used map widget on the web,[citation needed] Google Maps established many of the de facto standards in how a web map works.
Customized iframe embed URLs can be generated from the maps website (search/customize the view and then select "share"), or by constructing the URL query string yourself (a developer API key and account is required).
The Google Maps Platform includes a JavaScript API for generating map viewers and adding custom features and data layers. It also includes methods to access more complex search functions, local images, and other data. Most features require an API key and is billed by usage (page views or API requests).
Discuss this section on GitHub.
OpenStreetMap is a project to compile free-to-use wayfinding maps of the entire Earth, from crowdsourced contributions.
The interactive map on the group's website can be used to generate embeddable map widgets. Various options can also be specified in the URL for the embed source.
The image tiles created by the project can also be accessed directly by URL recipes, and these are used in other map viewer widgets and APIs. The raw data is also re-processed and used by other map data services.
Discuss this section on GitHub.
Bing maps provides embeds that can be generated from their website. For more complex options, the API can be used to generate widgets with minimal configuration, but also provides client-side APIs for manipulating the map, as well as an interface to Bing's search services. API tokens are required; free and paid plans are available, with usage caps.
Discuss this section on GitHub.
MapKit JS provides a JS framework for integrating Apple Maps in a website, with a client-side API for customizing interactions, and integrations with Apple search services.
A developer account is required, along with a method of generating encrypted API tokens on demand on the webserver.
Discuss this section on GitHub.
Mapbox provides map data as a service, as well as frameworks for multiple platforms. The GL JS framework generates map viewer widgets from client-side JavaScript calls, using WebGL for the actual rendering. Alternatively, the Mapbox Maps API returns complete HTML slippy maps based on URL configuration, and so can be used as an iframe source. These maps can be configured through Mapbox Studio, a graphical interface for building and styling maps. Each custom map is then assigned an ID, which can be passed into to the slippy map URL in order to fetch the map.
An API key is required, with cost based on usage.
Discuss this section on GitHub.
Leaflet is a popular open-source JavaScript framework for building customized map views. It doesn't currently have a declarative API, but widgets similar to map embeds can be generated with a few calls to the library methods.
Leaflet isn't associated with any particular map data source. It can use image tiles from most web map (tile) services.
Discuss this section on GitHub.
OpenLayers is one of the most established open-source libraries for creating dynamic web maps from map data in standard formats. As with Leaflet, it isn't associated with any particular map service. A basic slippy map can be created with a few lines of custom JavaScript.
Discuss this section on GitHub.
TomTom is a provider of geographic search and routing services and street map imagery. They provide software development kits (SDK) for mobile and web use, although their map tile and image APIs can also be used with other web map frameworks or GIS viewers. The viewer used by the web SDK is a customized wrapper around Leaflet.
TomTom's street map imagery is available as raster tiles, custom-generated raster images for specified bounds, or as vector tiles (using Mapbox's vector tile specification). The example pages use the vector data source.
Access to TomTom's map data and search APIs requires an account and API key; there is a daily quota of free transactions.
Discuss this section on GitHub.
The data visualization library D3 includes the d3-geo module which defines methods for manipulating vector map data (which the website author must provide). Unlike the other JS tools being reviewed here, D3 does not include code for a ready-made map viewer widget, but it is used for custom client-side mapping applications.
Discuss this section on GitHub.
The map viewer widget is the interactive component that displays a map to end users. The map might be the primary purpose of a website, or a small embedded element in a larger HTML page.
For this section of the review, we focus only on aspects of the map viewer that are generated by the map widget framework based on initial configuration and data by the website developers. In other words, these are the features that could be represented by elements and attributes in a native HTML solution. The next section, on client-side APIs, covers custom JavaScript manipulation and event handling for the map view.
We also skip over the technical details of how the map data is encoded,
and assume the browser can convert the map data into images on screen.
The potential requirements in this section describe ways in which map viewers
enhance the normal experience of viewing a static image (e.g., img
element)
in a web page.
§ 7. Map Data Formats for Map Viewers explores data structures and file formats.
This is the basic capability that is currently missing from the web: the ability to use HTML code alone to add a map to a web page.
Discuss this section on GitHub.
There are two types of web map implementations that currently come close: embeddable iframe maps, and HTML custom element wrappers to JS mapping libraries. The limitation of iframes is that all configuration must be contained in the source URL, instead of being able to use a proper markup API of attributes and child elements. The limitation of custom elements, currently, is that they require extra polyfill JavaScript in addition to the mapping library JavaScript.
TO DO: include img/picture, video, ...?
This functionality is the base requirement for a native HTML web map feature. Being able to define a basic map using markup would be one of the key benefit of having a built-in feature, compared to existing options.
Often, the website author does not want to specify the map data source or other details about the map; they just want a generic wayfinding map of the area.
Discuss this section on GitHub.
The embeds and commercial APIs all provide default street maps without the author needing to specify the map source. In contrast, the more flexible APIs must be combined with a separate map provider (e.g., OpenStreetMap).
No non-map uses for generating a default street map. But, there may be interest in displaying default maps as static images in addition to using them within map widgets.
…
This functionality is a highly valuable enhancement for native web maps, especially if it could be built on native platform features that allow the users to download maps in advance for later use. However, if user agents cannot integrate with a native operating system feature, they would need to rely on a third-party service for the map data.
If a web author already has (or can generate on the server) a map in a standard image format the browser can render — JPEG, PNG, SVG, etc. — can the map viewer display it as a map layer? Or will it need to be converted into a geospatial data format?
For most use cases, at least some additional metadata will be required, to align the image pixels to the geographic coordinates of the map.
Discuss this section on GitHub.
The majority of the embed maps do not support custom image layers. The API tools that do support this feature typically accept a layer source, attribution, and the coordinate system to be used by the image layers, which can be mapped to pixel units for more simple use cases.
This capability is essential in order to provide support for non-map materials. The ability to display non-georeferenced media like technical drawings, schematics or archival material within a standardized viewer has a wide variety of practical use cases.
The SVG image
element provides an example
of external image content being rendered into a specified rectangle within a coordinate system.
Similarly, the HTML Canvas2D API has a drawImage()
method
for rendering a scaled and positioned copy of an external image within the canvas.
A single image for an entire map layer is impractical on the web for large, pan-able maps at good resolution. For this reason, most web map services provide map data as tilesets. Beyond any default map layer that the viewer provides, can it process tilesets as a custom map layer? If so, in what form?
Discuss this section on GitHub.
All API tools support some form of this feature, whether it be in the more popular OpenStreetMap standard (often called XYZ), or the WMTS standard. For most services, tiles can be accessed through a URL with the X, Y and Z parameters defined, where X and Y represent the tile coordinates (not to be confused with latitude and longitude), and Z represents the zoom level. One thing to note is that while Google Maps and the OpenStreetMap standard both count tiles from the upper left corner of the map, the WMTS standard has the Y axis inverted, counting tiles from the bottom left, and some transformation may be needed when using certain tools with certain tilesets.
Users may disable JavaScript for security reasons, or as part of a strategy to reduce data consumption. In addition, JavaScript can fail because of network errors or because of a parsing or runtime error in the code.
It is reasonable that web maps have reduced functionality without JavaScript. But ideally, a basic map with text annotations and links should still work without it.
A natively-supported, declarative web map viewer would by definition have this capability.
Discuss this section on GitHub.
Our reference implementations are primarily JavaScript tools. Many do not — by default — provide any features when JS is disabled or fails, although a website author could build in fallbacks by including links, images, or iframes in the markup that are replaced when the script runs.
For built-in graceful degradation, iframe embeds potentially offer the best experience, but all of the reference tools do not support this by default, the map author must add this feature themselves.
To the extent that any capabilities of a map viewer are shared with other content, having that capability work without JavaScript is a shared benefit.
Based on the limited data, we are undecided about whether this should be a requirement.
Discuss this section on GitHub.
A map marker is a small icon that marks a point feature. Wayfinding maps often have extensive sets of icon markers that identify different types of features. In web maps, the pinpoint marker (a circle narrowing into a point at the bottom) has become standard for identifying any location of interest.
Discuss this section on GitHub.
Almost all of the reference tools support map markers in some way. While most embed tools include some kind of geocoder in order to support address lookup, the tools typically utilize latitude and longitude coordinates under the hood, and map authors can pass in the coordinates to the URL or configuration object upon initialization.
The notable standout here is the Google Maps Embed. Searching for a location by address will return information for a 'Place', each with its own ID and information such as business hours, reviews, and etc. The ID, rather than latitude and longitude, is passed into the iframe URL in order to bring up the additional location information for that particular place.
If the map element were to support non-georeferenced images, custom markers could be used as an annotation tool for technical drawings and other similar media.
SVG contains a number of elements that are positioned on a coordinate system. The coordinates and dimensions of the element are defined in markup, as attributes on the element.
The HTML Canvas2D API also offers the ability to draw points on a coordinate system, but images are drawn by passing coordinates into a JavaScript method, instead of an element such as in SVG. This method of drawing features is more similar to existing mapping libraries, which are also reliant on JavaScript. However, the Canvas API offers a very low level of abstraction in comparison to mapping libraries. Depending on the complexity of the marker, the code to draw it may be very verbose.
This functionality is a requirement for modern web maps.
Polygons and polylines are two of the most common types of map data features.
It is common on the web for vector map data to be pre-rendered into raster image layers on the server. However, if the vector feature is important for the web view, drawing it as separate graphic object means it can be dynamically styled, associated with labels or descriptions, and the target of user events.
Discuss this section on GitHub.
The tools that support this capability primarily fall under the API category. All of the API tools support the drawing of lines and polygons by passing in coordinates into a JavaScript function. Mapbox differs from the other implementations as it only accepts files in the GeoJSON format. The embed tools lack support for this capability.
SVG contains both a polyline
and a polygon
element.
A comma separated list of coordinates is assigned to the points
attribute to generate the shape.
The way that polylines and polygons are created in the HTML Canvas2D API is much more manual,
requiring a sequence of calls to the moveTo
and lineTo
methods.
Like other aspects of the Canvas API,
this syntax can be quite verbose.
TODO: Mention HTML area
and CSS polygon()
function.
TODO: describe how polyline/polygon are represented in the important geospatial specs.
Based on the limited data, we are undecided about whether this should be a requirement.
For a map to be truly a part of the web, it needs to be able to link to other web resources.
Discuss this section on GitHub.
The API tools all provide ways to bind event handlers to map features, allow map authors to display additional information when a map feature is clicked. While it is technically possible to to turn map features into an external link by using JavaScript, this is not a very common pattern as it may interfere with other user interactions such as panning and it can produce markup that is not consistent with the functionality of the map.
This functionality can be used to provide hyperlink support for diagrams. Any case where an image map may have been appropriate can also benefit from this capability.
HTML Image Maps consist of a large graphic with various subregions,
which serve as links.
A subregion is defined by passing a shape, coordinates, a link target and alt text to an area
element.
A significant limitation of image maps is that the coordinates of the area elements
are always defined in pixels and do not automatically scale to match changes in scale of the image
(see issue discussion on the HTML spec),
and this limits its usage in modern web development.
The SVG2 specification supports href
attributes on a
elements within SVGs,
previously, the SVG 1.1 specification required href
attributes to be specified within the XLink namespace.
Though it is not visible, Canvas elements can include keyboard focusable links as a part of a navigable sub DOM. In order to make links within the canvas work on click, JavaScript is still neccessary.
Based on the limited data, we are undecided about whether this should be a requirement.
Map data is subject to copyright, and use of the maps on the web usually requires at least attribution, and maybe links to terms of use. Many map services also include links for end users to report errors.
Discuss this section on GitHub.
Standard practice in the reviewed web map tools is to display this attribution in the lower right of the map widget. For map viewers that provide their own map data, the links and copyright is automatically generated. For map frameworks that allow the developer to specify the map data source, these "attribution control" values can be set in configuration.
Website authors can use Microdata and other related formats to provide attribution data in a standardized format. How and whether or not this content is displayed is up to the website author, but the goal is to provide a machine-readable format for important document content.
The cite element is for describing references to a cited creative work.
The HTML blockquote
and q
elements have a cite
attribute
where you can pass a URL as the source of a quote,
but browsers currently do not display this information to the end user.
Latitude and longitude defines a point on the Earth's surface, without requiring any further information. For website content, latitude and longitude data might come from photo or video metadata (from GPS-enabled cameras), or it might be calculated by the author using map search services. In a dynamic web app, latitude and longitude might be generated from geolocation on the user's device.
Discuss this section on GitHub.
All the reference tools allow the website author to display a specific location, defined by latitude and longitude, from a map tile set.
The Geolocation API and Geolocation Sensor API expose the user's location using latitude and longitude data. It should be possible to set the view on a web map using data returned from these APIs. Both of these APIs use the National Imagery and Mapping Agency Technical Report 8350.2, Third Edition as the technical definition of longitude and latitude (consistent with most modern geospatial standards), and a web map standard should use the same definition. [geolocation-API][geolocation-sensor][WGS84]
This functionality is a requirement for modern web maps.
For many mapping use cases, a website author won't have exact latitude and longitude values pre-calculated. They'll have street addresses or place names in a human-readable, localized format. To convert these addresses or names into a point on a web map, the web mapping service needs access to a Gazetteer search and corresponding databases.
Discuss this section on GitHub.
The majority of reference tools support this functionality, either through first party support or through popular plugins. This frequently takes the form of a search form that returns a possible list of options that the map author can select from. The Google Maps geocoder is the gold standard amongst these implementations, as it is more forgiving in terms of search format and provides better support for different localizations than other alternatives.
There are many cases where a website may expect an address from a user. An input type specifically for addresses has a wide variety applications other than displaying a map, such as reducing user error when facilitating e-commerce and delivery services.
Both the autocomplete
attribute on HTML form controls
and the Payment Request Payment Address Interface
represent existing attempts to standardize what an address is.
It is noteable that between these two implementations,
there are differences in the way that various fields are named,
and further research would be needed to determine the best path forward.
Based on the limited data, we are undecided about whether this should be a requirement.
Most tiled image maps on the web use the Web Mercator system of dividing map data into image tiles. As the name suggests, this is based on the Mercator map projection, with the addition of standard for dividing the map into tiles at different zoom levels.
Web Mercator is not appropriate for maps of polar regions, where the Mercator projection distorts geography. Other tileset coordinate systems have been defined specifically for polar maps. In addition, many regions have well-established local map grid coordinate systems, and being able to use the local grid means access to established map data sources.
The technological complexity of supporting different projections depends on how many other capabilities are supported. Tiling images doesn't require knowing how those images map to geographic coordinates. But the tile boundaries and coordinate projection are needed in order to draw marker points or vector features over the map. And information about the tileset zoom levels is required in order to dynamically load content on pan and zoom.
Combining map layers with different projections, or otherwise converting one map projection to another view, is a separate capability, discussed in § 5.3.4 Reproject map tile data into a new projection or globe view.
Discuss this section on GitHub.
With the Google Maps API, you are able to create custom rectilinear projections, by passing in a bi-directional mapping between coordinate systems. Leaflet.js supports the Equirectangular, Elliptical Mercator and Web Mercator projections by default, and you can use the external plugin Proj4Leaflet to support other projections. OpenLayers also relies on Proj4 in order to support other projections.
Support for this capability would allow for non-georeferenced maps to be displayed, such as maps of non-earth planets and fictional spaces.
This capability would also provide support for the visualizing anything that exists in a Euclidean coordinate system, such as charts that follow a cartesian coordinate system or spherical coordinate systems, including diagrams for a variety of engineering, scientific and medical purposes.
The Geolocation API already provides a standard interface for latitude and longitude coordinates under the WGS94 system, but currently no other reference systems are supported.
Based on the limited data, we are undecided about whether this should be a requirement.
Map image tiles are usually defined in Web Mercator or other grid-based tile systems. For large scale maps (of the globe or continents), these reveal distortions created by the underlying projections. Many different map projections exist to more fairly display the relative size and shapes of continents on a flat map. In addition, within an interactive web environment, it is possible to use projections which more directly represent the 3D globe without trying to display it all at once, letting user interaction rotate it to show parts of interest.
Discuss this section on GitHub.
None of the reference tools support this feature. For the tools that support alternative projections, it is possible to to work around this by reinitializing the map in a different projection.
The number of related specifications that deal with spatial transformation in some way suggest that there is a desire for the ability to utilize things like general mesh transformations. Adding support for reprojection in a map capacity may have the added benefit of providing a foundation for general graphical and text transformation.
There are many existing web specifications which support the transformation of graphics to some extent. The best example is the feDisplacementMapElement filter. Originally designed for SVG, it can be used to spatially displace an image on the fly. Also from SVG is the TextPathElement, where text can be rendered along an arbitrary, author-specified path.
The CSS transforms specification offers a simple way to transform elements, ranging from simple 2D transforms such as 'skew' to composite transformations in a 3D space.
In terms of 3D examples, WebGL is an example of a web specification where projecting a flat image or 3D texture onto a curved or spherical surface is possible. WebGL is already used in some cases for interactive reprojection for non-map use cases.
Based on the limited data, we are undecided about whether this should be a requirement.
For the user, it is often useful to bookmark or save a location from a map, separate from the website which included it. The user may want to export the location to a GPS or native mapping application so they can calculate directions to it.
Discuss this section on GitHub.
Most of the reference tools do not support this capability. Of the tested tools, only OpenStreetMap offers the option to export a map location in a standard format.
The Web Share API is a specification that is designed for sharing links and other content to a destination of the user's choice.
The API was designed to be extended to allow for sharing new types of data
via adding new members to the ShareData
dictionary.
Though not exclusively a web specification, the Geo URI scheme represents a standard way to represent locations within a given coordinate reference system. However, it is important to note that Geo URI is considered to be a location estimate, not an exact location.
The WICG Text Fragment specification is an example that builds upon the existing use of URL fragments in order to allow direct linking to a specific portion of text within a page. In order to not conflict with the existing URL fragment, this specification introduces a fragment directive delimiter string (":~:") to indicate that the fragment is a text fragment.
When available as an option for map authors, custom styling should be set in a declarative way. Map markers can be either raster or vector images, with all relevant styling properties available to them. Vector features should have a variety of presentational properties available to style them, similar to how SVGs are styled on the web.
Discuss this section on GitHub.
Mapbox is unique amongst the reference tools as it offers a GUI where styling can be applied to each vector feature. Their style editor is extremely powerful, and styles can be applied across particular zoom ranges, data ranges, or even through conditional logic.
Behind the scenes, Mapbox's styles are stored in a JSON object that conforms to their own Style Specification. The TomTom SDK for Web accepts custom styles in the format of Mapbox's Style Specification.
For the other reference tools, custom styles can be passed in as a JavaScript object on map initialization. There is significant overlap between the style properties used by these example tools and properties for formats like SVG, such as 'stroke width', 'fill', 'opacity'.
SVG elements have many styling properties, describing the fill color or patterns as well as stroke (outline) color, size, and dashing patterns. These are specified using CSS methods (e.g., classes and other selectors) or directly as element attributes. In addition, SVG 2 allows some aspects of the vector shape's geometry to be specified in CSS.
Custom elements are able to isolate styles via the Shadow DOM, which prevents style selectors defined outside the component to match elements within it, or vice versa, while still allowing some style inheritance. A similar approach could be useful for scoping map specific styling to its containing element.
Based on the limited data, we are undecided about whether this should be a requirement.
This capability — custom styling — is separate from the ability of the author to create complete custom controls which then control the map viewer using a client-side API.
Discuss this section on GitHub.
Only Leaflet.js and OpenLayers provide a method to style map controls freely. Because these tools are JavaScript libraries and not iframe embeds, their controls can be styled by writing CSS that overrides the default styling. TomTom SDK inherits this capability due to it being a wrapper over Leaflet.js.
The Google Maps API provides limited options when it comes to styling map controls. The map author has the ability to set which form the controls take (dropdown or horizontal bar), and set the position of the controls.
Custom elements are encapsulated pieces of functionality that can inherit styling from the context that they are in. CSS Shadow Parts allows web component authors to expose named parts within their custom element's shadow DOM, for styling by the web page author. A custom element based approach would allow for map authors to style the map controls without requiring them to implement the logic behind them manually.
HTML form elements have traditionally lacked ways for web developers to style them, which has led to developers implementing their own versions of form elements in order to apply their own styling, often to the detriment of semantics and accessibility.
Based on the limited data, we are undecided about whether this should be a requirement.
Custom styling isn't always enough; sometimes an author wants to completely replace the default control buttons. Replacing the full functionality of the controls requires a client-side API, discussed separately. This capability focuses solely on the ability to declaratively control whether or not the web browser includes on-screen controls by default.
Discuss this section on GitHub.
Amongst the reference tools that support this capability, toggling the visibility of default controls is as simple as setting a boolean in a configuration object.
HTML Media Elements (which consists of the <video>
and <audio>
element)
include a controls attribute that indicate whether or not the author would like the user agent to display controls.
Based on the limited data, we are undecided about whether this should be a requirement.
Client-side Mapping APIs (application programming interfaces) allow website developers to create customized map viewers, or other geographic applications. Existing APIs are JavaScript libraries that offer ready-to-use functions for fetching or rendering parts of a map, or for manipulating a map-viewer widget. A built-in web map solution would need to expose similar DOM APIs to JavaScript code.
This is the starting point for all API usage.
Discuss this section on GitHub.
Implementations differ in how much is expected of the developer wishing simply to initialise and display a map. Those APIs that are tightly bound to a single source of mapping data tend to provide a single method call with options for configuration, whereas APIs that are data-provider-agnostic at least require initialisation of data sources in addition.
Implementations also differ in the sources and types of mapping data they support. Tiled raster map layers, with additional support for vector layers to provide supplementary content such as routes, are widely supported. Some implementations also support rendering maps using tiled vector map layers or untiled vector data.
full support: Google, Bing, MapKit and TomTom allow straightforward creation of a map with configuration options.
Leaflet, OpenLayers, and MapBox require explicit construction of objects defining the map layers and viewport, with sensible defaults for creation of, for example, a map showing OpenStreetMap tiles in a standard National Imagery and Mapping Agency Technical Report 8350.2, Third Edition projection. This provides added flexibility, at the expense of increasing the complexity of code that uses these libraries.
supported, with limitations: The d3-geo module supports vector data in the form of either GeoJSON or TopoJSON. It renders this data to either an SVG or Canvas element. It requires the developer to implement support for interaction using other d3 modules, such as d3-zoom and d3-transition.
By utilising the d3-tile module, tiled raster data can be combined with vector map data.
Leaflet, OpenLayers, and MapBox allow for the creation of layers displaying non-geographical raster tiles.
The HTML Standard specifies a number of aspects of elements that embed media in a web page and expose JavaScript APIs to enable interaction and dynamic configuration.
The DOM Standard provides interfaces for creating HTML elements, which are what these implementations are using under the hood.
Scalable Vector Graphics (SVG) 1.0 Specification provides interfaces for creating vector graphics. These are used as one of the available primary methods of rendering map data by d3-geo, and for rendering supplementary content by other implementations.
The GeoJSON Format defines a method for representing geographical data in JSON. This is one of the primary data formats supported by d3-geo and is also used by other implementations for representing additional content.
DOM Standard HTML Standard Scalable Vector Graphics (SVG) 1.0 Specification The GeoJSON Format
This functionality is a requirement for modern web maps. Incorporating this functionality of existing map libraries in HTML would benefit users by reducing download size and time to interactivity. Web developers would benefit from being able to program against a standard interface.
However, it is to be expected that a native HTML web map element would be constructed and initialised via existing DOM interfaces such as document.createElement and DOMElement.insertAdjacentHTML. Additional aspects of the map element's configuration might be achieved either through existing DOMElement interfaces such as setAttribute, or through element-specific attributes and methods; cf. the attributes and methods of the HTMLMediaElement.
Markers are discussed in more detail at § 5.2.1 Show pinpoint locations or custom markers on the map. The APIs provided for adding markers to a map generally allow a developer to use default icons or to specify their own, to specify a short label such as a letter or number to be displayed within a marker, and to attach annotations which are displayed when the marker is selected by the user.
Discuss this section on GitHub.
Existing implementation support:
These implementations all provide straightforward APIs for adding markers to locations using a default icon.
Rather than providing a straightforward API, OpenLayers requires a number of steps to be followed: providing icon imagery (as there is no default imagery provided), creating icon features, creating a map layer to hold those features, and finally adding the layer to a map. This is noticeably more complex than the APIs provided by a number of other implementations.
By default, d3-geo will render point features as circles. These can be styled using whatever techniques are being used to style the map content, typically either using presentational SVG attributes, or CSS. In practice, adding markers in a manner similar to that offered by other mapping APIs might best be achieved by dynamically creating a GeoJSON feature containing the point features in a FeatureCollection and adding this as an additional layer on the map.
In cases where non-geographical data is being displayed, markers could indicate points of interest in the same way that they do on maps.
The GeoJSON Format defines a method for representing geographical data in JSON. This is one of the primary data formats supported by d3-geo and is also used by other implementations for representing additional content. For adding markers to a map, a GeoJSON FeatureCollection containing one or more points can be used.
This functionality is a requirement for modern web maps. Incorporating this functionality of existing map libraries in HTML would benefit users by reducing download size and time to interactivity. Web developers would benefit from being able to program against a standard interface.
Controls are user interface elements that enable interaction with the map. Map implementations typically provide a number of default controls supporting interactions such as zooming and switching layers.
A map implementation will typically provide the developer with various options for configuring controls. This will include such capabilities as adding and removing controls, showing or hiding them, and being notified of changes in their state. It is also necessary to provide support for controlling the positioning of controls, to avoid the situation where two controls occupy the same position on the map's UI.
Developers may wish to implement additional controls, either replacing the functionality of the map's default controls, or adding new functionality. Map implementations should provide APIs to support such custom controls, allowing them to integrate fully with the map at a level that is on a par with the map's own controls.
Discuss this section on GitHub.
Support for controls varies widely among existing map implementations. It is generally the developer's responsibility to create a suitable DOM construct, styled with CSS and augmented with JavaScript to provide behaviour, for use as a control. But though some implementations specify detailed APIs which controls should support in order to be properly integrated with the map, others provide minimal support and expect the developer to take full responsibility for responding to control lifecycle transitions.
All of these implementations fully support the concept of controls, including support for control implementations to be notified when they are added to or removed from the map, so they can update their own internal state accordingly. They also allow controls to request their desired positioning within the map's UI, and will position controls using sensible defaults if developers choose not to implement that capability.
MapBoxGL specifies an interface to which controls are expected to conform. The map API provides methods for adding and removing controls to and from the map UI.
Leaflet, TomTom (which uses Leaflet), and OpenLayers provide base classes which controls extend, along with map methods for adding and removing controls. OpenLayers also exposes its control collection directly.
While Google Maps supports the adding and removing of controls and the specifying of their placement within a number of predefined areas within the map's UI, there is no specific interface to which they are expected to conform.
Bing Maps expects controls to be implemented as a type of overlay. It provides no particular support for controls beyond that, not even for positioning them within the map UI, which is left to the developer to achieve using CSS positioning.
Apple MapkitJS does not provide an interface that can be implemented to create a custom control, nor does it have any generic mechanism for adding and removing controls beyond those provided.
Although d3 supports a variety of user interactions, the concept of a user interface presenting a collection of controls to the user is not part of the library.
As controls are explicitly intended as part of the map's user interface, further uses for the concept might be found in other cases where complex interactive content is presented by an element, such as adding controls to media containers.
It might seem that, as controls are implemented using existing interactive HTML elements, there is no pressing need for them to be supported by additional APIs. However, the need for them to be closely integrated with a map's own UI, state, and lifecycle suggests that this functionality is a requirement for modern web maps.
Adding a layer to a map viewer is a fundamental capability, as without it the base layer itself could not be added to the viewer. While map viewer implementations from a provider of mapping data can be expected to automatically add a base layer showing the data they provide, other implementations require a base layer to be explicitly created and added to the map as part of its initial configuration.
Adding further map layers other than the base layer allows additional information to be presented to the user in geographical context.
Discuss this section on GitHub.
All of the reviewed APIs support the creation of alternative base layers for the map, and the addition of layers to the base map. Both raster and vector layers are supported.
The implementations from mapping data providers generally require additional configuration to be specified in the case where an alternative base layer that does not use their data is provided.
As a map viewer provides the ability to pan and zoom imagery covering a large extent, there are many alternative uses. Some examples include works of art that have been digitised at ultra high resolution, allowing anyone to examine them in fine detail, and ultra high resolution panoramic photographs.
Based on the fundamental nature of this capability, it is a requirement for web map APIs. In addition to providing basic and extended capabilites for the display of geographic data, it also allows the repurposing of such APIs for wider application.
Existing commercial implementations will generally show map data from a preconfigured source, while open-source implementations will either provide or document an initial configuration using open map data. But many applications require the use of alternative sources of map data, and it is therefore necessary that a map implementation provide suitable APIs for the configuration of such sources.
Configuring alternative data sources is also necessary to support the display of non-geographic tiled imagery.
Discuss this section on GitHub.
Existing implementation support:
All implementations support the creation of a layer with a specified data source that conforms to an OWS standard. This requires specifying a way for the layer to access the data source, which is achieved by specifying which OWS protocol to use along with a URL template. Some implementations support the use of a URL template function to return the required tile URLs when invoked with arguments specifying the geographical position and extent the required tile should represent.
All uses of map implementations to display non-geographical imagery require this capability.
Based on the fundamental nature of this capability, it is a requirement for web map APIs. In addition to allowing for the display of alternative geographic data, it also allows the repurposing of such APIs for wider application.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
All of the API-based map viewer implementations support the use of vector data defined in a number of standard formats, such as GeoJSON and KML. When topogeographical data is available that is not already in one of the widely-supported formats, application developers can readily convert that data into object structures that can be utilised by the existing APIs, such as the structure of a GeoJSON object.
ToDo
This functionality is a requirement for modern web maps, as there are numerous sources of such data. Furthermore, vector data allows a level of precision higher than that achievable with raster data, or that it may not be convenient or possible to present in the form of rasters.
Point intensity data is a useful way of representing the distribution of a phenomenon across geographical areas. Examples include frequency of earthquake occurrence in different regions, the distribution of types of vegetation found in an area, or the spread of a global pandemic at a particular point in time.
It is possible to preprocess such data into a raster or vector format for display, but giving a map implementation the capability of rendering such data into an overlay directly averts such problems as maintaining consistency between multiple representations of the same data. Implementations will commonly accept point intensity data defined in a number of standard vector data formats, such as KML or GeoJSON.
Discuss this section on GitHub.
Existing implementation support:
All of these implementations support the display of point intensity data as a heatmap. In the case of Google Maps, it is necessary to specify the inclusion of support declaratively when loading the script library. Typically, a vector data source object is defined in JavaScript either by specifying the URL of a resource or by specifying the data directly in code.
Bing Maps has native support for heatmaps via a separate module that must be explicitly loaded in JavaScript, rather than being specified declaratively in HTML. Leaflet (and by extension TomTom) and d3 have third-party plugins available which add support.
MapKit JS does not support a heatmap overlay at present, and no third-party plugins adding support are known of.
Heatmaps have existing applications unrelated to geography in a number of fields. For example, they are used in molecular biology for such purposes as visualizing gene expression. An implementation capable of displaying non-geographic point intensity data would therefore have potential value in the display of such data on the web.
This functionality could be added to enhance native web maps in the future.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
Based on the limited data, we are undecided about whether this should be a requirement.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
Based on the limited data, we are undecided about whether this should be a requirement.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
Based on the limited data, we are undecided about whether this should be a requirement.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
Based on the limited data, we are undecided about whether this should be a requirement.
Developers expect to be able to control a map by changing its centre and/or zoom level, and may also wish to support the capability of resetting a map to its view as originally presented. If the map view cannot be dynamically modified by an application, as opposed to changes by direct user interaction with the map, then it offers fewer advantages over a static map view.
It is usually also desirable that such changes can be accomplished in a manner that gives sufficient visual feedback to the user that a change is occurring, for example by animating the transition rather than simply redrawing the map with the new view, which may not be immediately noticeable to the user.
Accessibility is an important consideration when the state of a map is altered dynamically. Thought should be given to how the change can be made known to assistive technologies so that the user is fully informed and thus cognisant of the current state of the map at all times.
Discuss this section on GitHub.
All the reviewed JavaScript API implementations support changing the bounds, centre, and zoom level of a map, and allow such transitions to be animated.
Animated transitions are supported by calling specific methods with names such as flyTo
or via a Boolean parameter to a more general method such as setView
.
This capability would be relevant to use of web map technology for the display of non-geographic imagery, such as navigating the view to relevant parts of a complex diagram as the user progresses through related content.
As this is capability is required for any dynamic update of a map view such as would be expected of a map-based application, it is a requirement for embedded web maps.
A web application embedding a map will commonly need to respond to changes in the state of the map, whether as a result of user activity or from other causes, so that it can update its own internal state and user interface as necessary to remain consistent with the map view. At a minimum, any change of the area displayed by the map needs to be notified to the application. In practice, it is usually desirable for other high-level events within the map view to be exposed as well. This allows an application fine-grained control of the level of detail of interactions it responds to, from simple updates when the map is moved or the zoom level is changed, to detailed feedback during user interactions of longer duration such as continuous panning.
In addition to events relating to the state of the map view itself, developers will expect to be able to receive notifications of events triggered by other components within the map such as controls, markers, and layers.
A native HTML map element would be expected to support the existing DOM event binding interface,
using the standard addEventListener()
method to bind listener functions to map events,
and receiving an object derived from the standard Event
interface
as the argument to such functions.
Discuss this section on GitHub.
Implementations of map events vary widely in both the terminology used and the semantic richness of the events available.
For example, the Google Maps API provides events named center_changed
and zoom_changed
, allowing a developer to provide discrete event handlers for such changes.
The Leaflet API supports similar events, but named moveend
and zoomend
.
The Bing Maps API, on the other hand, provides a more general viewchangeend
event,
and the handler for this event must examine the state of the map to determine what has changed.
APIs generally also provide lower level events directly correlating to user interactions,
such as click
and mouseover
in the Google Maps API, though again terminology varies.
The event objects passed to handlers of such events have additional properties compared to their equivalents
in normal DOM event handling, such as a property giving the position of the event in terms of latitude and longitude.
Although all existing implementations support an events system capable of meeting the needs of developers, inconsistencies in terminology, semantic richness, and the interfaces provided for adding and removing event listeners mean that it is unclear whether any one of the existing APIs would be a suitable model for the various capabilities available across the entire range of them.
As it is anticipated that standard DOM event interfaces would be the basis for an HTML map's event system, it is likely that further uses could arise for such capabilities. For example, an HTML text annotated with geographical microdata could allow DOM events arising from user interaction (such as clicking on the name of a city within the text) to be enhanced with the same kind of position property, specifying latitude and longitude, as would be present in an event object created by a similar interaction with a map element.
As outlined above, it is expected that events as defined in DOM Standard would form the basis for a map element's event system.
HTML Standard media objects provide an existing example of extending the basic event system to support particular capabilities of embedded content.
This capability is a requirement for the scripting API of a native HTML map element. Responding to changes in the state of a map, or user interactions with elements of the map such as markers, is necessary for a web application to usefully modify its own state so as to reflect the results of such interactions.
Although the default bearing of a map - that is, the direction of "up" - is usually north, it can be useful to change this.
Discuss this section on GitHub.
Existing implementation support:
This capability could be useful when a map viewer is used to display zoomable technical drawings.
This functionality could be added to enhance native web maps in the future.
An API should support allowing the map to be moved to display a given location.
Discuss this section on GitHub.
Existing implementation support:
ToDo
This functionality is a requirement for modern web maps.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
Based on the limited data, we are undecided about whether this should be a requirement.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
This functionality could be added to enhance native web maps in the future.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
This functionality could be added to enhance native web maps in the future.
Description to follow
Discuss this section on GitHub.
Existing implementation support:
ToDo
Based on the limited data, we are undecided about whether this should be a requirement.
Many different types of spatial data can be integrated in a web map: satellite imagery, cartographic representations of roads and terrain, 3D building profiles, pinpoint locations with annotated descriptions, route directions or other polyline paths, and more. Many standard and proprietary formats exist to describe this data.
A built-in web map viewer will need to work with spatial data that is already available from web servers, or that can be provided with minor server upgrades.
To Do: finish the script to generate a summary table from the annotated markup.
We are tracking issues on Github.
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in:
Referenced in: