OGC Testbed-14: MapML Engineering Report OGC Testbed-14: MapML Engineering Report Publication Date: 2019-03-06 Approval Date: 2018-12-13 Submission Date: 2018-12-09 Reference number of this document: OGC 18-023r1 Reference URL for this document: Category: Public Engineering Report Editor: Joan Masó Title: OGC Testbed-14: MapML Engineering Report OGC Engineering Report Copyright (c) 2019 Open Geospatial Consortium. To obtain additional rights of use, visit WARNING This document is not an OGC Standard. This document is an OGC Public Engineering Report created as a deliverable in an OGC Interoperability Initiative and is not an official position of the OGC membership. It is distributed for review and comment. It is subject to change without notice and may not be referred to as an OGC Standard. Further, any OGC Engineering Report should not be referenced as required or mandatory technology in procurements. However, the discussions in this document could very well lead to the definition of an OGC Standard. LICENSE AGREEMENT Permission is hereby granted by the Open Geospatial Consortium, ("Licensor"), free of charge and subject to the terms set forth below, to any person obtaining a copy of this Intellectual Property and any associated documentation, to deal in the Intellectual Property without restriction (except as set forth below), including without limitation the rights to implement, use, copy, modify, merge, publish, distribute, and/or sublicense copies of the Intellectual Property, and to permit persons to whom the Intellectual Property is furnished to do so, provided that all copyright notices on the intellectual property are retained intact and that each person to whom the Intellectual Property is furnished agrees to the terms of this Agreement. If you modify the Intellectual Property, all copies of the modified Intellectual Property must include, in addition to the above copyright notice, a notice that the Intellectual Property includes modifications that have not been approved or adopted by LICENSOR. THIS LICENSE IS A COPYRIGHT LICENSE ONLY, AND DOES NOT CONVEY ANY RIGHTS UNDER ANY PATENTS THAT MAY BE IN FORCE ANYWHERE IN THE WORLD. THE INTELLECTUAL PROPERTY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE INTELLECTUAL PROPERTY WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE INTELLECTUAL PROPERTY WILL BE UNINTERRUPTED OR ERROR FREE. ANY USE OF THE INTELLECTUAL PROPERTY SHALL BE MADE ENTIRELY AT THE USER’S OWN RISK. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY CONTRIBUTOR OF INTELLECTUAL PROPERTY RIGHTS TO THE INTELLECTUAL PROPERTY BE LIABLE FOR ANY CLAIM, OR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM ANY ALLEGED INFRINGEMENT OR ANY LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR UNDER ANY OTHER LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH THE IMPLEMENTATION, USE, COMMERCIALIZATION OR PERFORMANCE OF THIS INTELLECTUAL PROPERTY. This license is effective until terminated. You may terminate it at any time by destroying the Intellectual Property together with all copies in any form. The license will also terminate if you fail to comply with any term or condition of this Agreement. Except as provided in the following sentence, no such termination of this license shall require the termination of any third party end-user sublicense to the Intellectual Property which is in force as of the date of notice of such termination. In addition, should the Intellectual Property, or the operation of the Intellectual Property, infringe, or in LICENSOR’s sole opinion be likely to infringe, any patent, copyright, trademark or other right of a third party, you agree that LICENSOR, in its sole discretion, may terminate this license without any compensation or liability to you, your licensees or any other party. You agree upon termination of any kind to destroy or cause to be destroyed the Intellectual Property together with all copies in any form, whether held by you or by any third party. Except as contained in this notice, the name of LICENSOR or of any other holder of a copyright in all or part of the Intellectual Property shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Intellectual Property without prior written authorization of LICENSOR or such copyright holder. LICENSOR is and shall at all times be the sole entity that may authorize you or any third party to use certification marks, trademarks or other special designations to indicate compliance with any LICENSOR standards or specifications. This Agreement is governed by the laws of the Commonwealth of Massachusetts. The application to this Agreement of the United Nations Convention on Contracts for the International Sale of Goods is hereby expressly excluded. In the event any provision of this Agreement shall be deemed unenforceable, void or invalid, such provision shall be modified so as to make it valid and enforceable, and as so modified the entire Agreement shall remain in full force and effect. No decision, action or inaction by LICENSOR shall be construed to be a waiver of any rights or remedies available to it. None of the Intellectual Property or underlying information or technology may be downloaded or otherwise exported or reexported in violation of U.S. export laws and regulations. In addition, you are responsible for complying with any local laws in your jurisdiction which may impact your right to import, export or use the Intellectual Property, and you represent that you have complied with any regulations or registration procedures required by applicable law to make this license enforceable. Table of Contents 1. Summary 1.1. Requirements & Research Motivation 1.2. Prior-After Comparison 1.3. Recommendations for Future Work 1.4. Document contributor contact points 1.5. Foreword 2. References 3. Terms and definitions 3.1. Abbreviated terms 4. Overview 4.1. MapML in relation to other encoding 4.2. MapML as a media type 5. CRSs in MapML 5.1. Introduction 5.2. CRS types in MapML 5.3. CRS negociation 6. URL templates 6.1. Evolution of the interaction between clients and services exchanging MapML. 6.1.1. Features can be linked as well as embedded 6.1.2. Static MapML 7. Feature Encoding 7.1. Current version encoding 7.2. Encoding geometries 7.2.1. How different is GeoJSON in MicroXML from GML? 7.2.2. Adding CRS 7.3. Encoding attributes in features 7.3.1. Encoding feature properties with Microdata. 7.3.2. Alternative 1: Compact geometry encoding with microdata 7.3.3. Alternative 2: Compact geometry encoding with microdata 7.3.4. Alternative 3: GML geometry encoding with microdata 7.4. MapML in relation to vector tiles 8. CCS Symbolization 8.1. How to apply css styles to geometries 8.2. Limitations in CSS 8.2.1. You cannot set a selector based on the value of the element. 8.2.2. You cannot set select an element of the HTML and apply the symbol to another element 8.3. Extensions of CSS to support geospatial requirements 8.4. Selecting alternative styles for MapML 9. Events 9.1. Maps4HTML events 9.1.1. Proposed Maps4HTML events 10. Other aspects in MapML 10.1. MapML and CORS 10.2. Languages in MapML 10.3. Considerations on multidimensional data (and time) in MapML 11. Testbed-14 Implementations 11.1. Cloud Based Proxy (cascade) for MapML 11.1.1. Requirements 11.1.2. Approach 11.1.3. Implementation 11.2. ServiceWorker Proxy for MapML 11.2.1. Requirements of MapML Browser Extension 11.2.2. Approach 11.2.3. Restriction 11.2.4. Software Design 11.2.5. Software Environments 11.2.6. User Interface 12. Including MapML in social media. 12.1. The use of MapML as the new media for exchanging maps. 12.2. Drag and drop maps. 12.3. Tests trying to share maps 13. OGC Web service to produce MapML. 13.1. A proposal for new services that integrate maps and tiles Appendix A: OpenAPI Appendix B: Revision History Appendix C: Bibliography 1. Summary This is the second Engineering Report (ER) about the Map Markup Language (MapML) [ ] resulting from OGC Testbed initiatives. To find an introduction of MapML and how it works, please, refer to the previous ER OGC 17-019 [ ]. MapML is a new media type that can be included in a element of a
Use content negotiation to request HTML or GeoJSON. operationId getFeatures tags Features parameters $ref: '#/components/parameters/collectionId' $ref: '#/components/parameters/bbox' components parameters collectionId name collectionId in path required true schema type string bbox name bbox in query required false schema type array minItems maxItems items type number style form explode false Even if the authors of this document consider mentioning the difference, they do not perceive this as a problem. MapML can document a more restrictive URI template containing the query variables provided that the proposed template is compatible with the requirements of the WFS 3.0 (provided that the KVP syntax for the query variables is followed). Interestingly, WFS 3.0 uses GeoJSON as a default encoding and WGS84 for the coordinates, which is compatible with the way MapML is defined today. Implications for OWS Context In OGC Testbed-13 there was a discussion on the similarities to other standards and in particular to OWS Context. The evolution of MapML into a more static client-server interaction moved MapML a step closer to OWS Context documents. OWS Context provides a way to create a document describing the viewport on an integrated client. OWS Context documents can encode the presence of one or more geospatial services that will be opened by a user interface when the document is loaded. There are still significant differences. In OWS Context, a sample of a server GET request is included instead of a URI template. There is an assumption that the client knows about the logic of the service requests and there is no need to include a URI template or any reference to variables on the URI template pattern. When writing a context document, developers can take the logical decision of at least providing a URL sample that that covers the viewport, but this is not mandatory in OWS Context. In other words, OWS Context assumes that the client is fully aware of the mechanics of the GET URLs used in OGC services and will be able to read the capabilities document, extract all the information it needs about the service and its layers and formulate GET requests when it needs it. In contrast, MapML provides the client with enough information to formulate GET requests for sending to the server by using URI templates and input variables, and does not require knowledge of the geospatial standard used in the request. 7. Feature Encoding This section discusses approaches for encoding feature information in MapML. MapML features do not consider any form of vector tiles yet. Instead, features are provided as points, lines, polygons (and aggregations of them), the geometry of which is encoded as coordinates in one of the defined coordinate systems. 7.1. Current version encoding The current proposed encoding is a direct translation of the GeoJSON Encoding into a MicroXML. The following code is an example of how a MultiPolygon looks like in the current MapML encoding. Code Example of a MapML containing embedded feature information
7.2. Encoding geometries This subsection discusses the encoding of geometrical characteristics of a feature. 7.2.1. How different is GeoJSON in MicroXML from GML? This section demonstrates that the geometrical part of GeoJSON in MicroXML is not so different from a conveniently simplified GML encoding. It is true that GML encoding may appear intimidating but the main complexity of GML originates in the need for preparing an application schema that consequently inherits the complexities introduced by XML validation. If an application is only interested in the geometrical classes and is thus limited to a concrete version of GML (as they are predefined in the GML standard, e.g. v3.2) the need for an application schema disappears, and most of the complications dissipate! In addition, the GML subsections used in MapML can be totally included in MapML avoiding the need to check a long GML document. Given the self-imposed restrictions in the GeoJSON specification, the authors of this ER are still not convinced of the advantages of GeoJSON in MicroXML and the need to specify a new encoding for XML, instead of using what GML has defined for more than a decade. The following subsections compare both encodings. Note Despite the arguments exposed on this subsection, the authors of the MapML specification still prefer the use of GeoJSON in MicroXML encoding because they believe that it could be better accepted by the Web community. Points Surprisingly, the GML notation for a point is even more compact than the GeoJSON equivalent. Point example in GeoJSON in MicroXML 123 321
The same point example in schema-less GML 123 321
Lines The GML notation for a line looks surprisingly similar to the GeoJSON equivalent. Line example in GeoJSON in MicroXML 123 321 122 322
The same line example in schema-less GML 123 321 122 322
Polygons Things start to get a bit more complicated for polygons in GML but the encoding is much more readable and makes a clearer distinction between external and internal rings. Polygon example in GeoJSON in MicroXML 103 421 104 422 106 342 103 321
123 321 112 132 112 132 123 321
In GeoJSON there is an assumption that the first ring is the exterior one, but this can be too restrictive. Polygons might need more than one exterior ring. The same polygon example in schema-less GML 103 421 104 422 106 342 103 321
123 321 124 322 126 322 123 321
Multipoint Multi-feature objects are a bit more verbose in GML but not much. Multipoint example in GeoJSON in MicroXML 1 1
2 2
The same multipoint example in schema-less GML 1 1
2 2
Note During the discussion on this topic, a mistake in the definition of MultiPolygons was spotted and corrected by the authors of the MapML specification. 7.2.2. Adding CRS During the discussions in this testbed, the need for alternative CRSs was identified. On one hand, if provided in the same coordinate reference of the tiles (for example in TCRS), the web browser can render them directly. In this case the web browser only needs to apply an offset to move the origin from the top-left corner of the tiled space to the top-left corner of the viewport to have coordinates that SVG or Canvas can use. On the other hand, GCRS coordinates can be easily supported due to the existence of open source JavaScript libraries (e.g. proj4js) that are available to transform latitude/longitude coordinates (GCRS) into projected coordinates (PCRC) that can later be transformed into TCRS and then to the viewport coordinates by applying a linear (scaling and offsetting) transformation. If the GeoJSON abstract rules are strictly followed as stated in the IETF specification, the only possible option is to use GCRS coordinates in WGS84. This is the text of the specification forcing this rule: The coordinate reference system for all GeoJSON coordinates is a geographic coordinate reference system, using the World Geodetic System 1984 (WGS 84) [WGS84] datum, with longitude and latitude units of decimal degrees. This is equivalent to the coordinate reference system identified by the Open Geospatial Consortium (OGC) URN urn:ogc:def:crs:OGC::CRS84. Note: the use of alternative coordinate reference systems was specified in [GJ2008], but it has been removed from this version of the specification because the use of different coordinate reference systems has proven to have interoperability issues. — GeoJSON standard Note MapML should decide if it strictly follows the GeoJSON rules or it supports other CRS. Can MapML be produced directly in a coordinate system that escapes the need of performing complicate floating point operations used in projection formulas? Obvious alternatives are "tcrs" "tilematrix", "map" and "tile" coordinate systems. The "tile" coordinate system can be disregarded because it is local to a single tile and more than one tile are needed to fill the map. The "tilematrix" can also be disregarded because of insufficient accuracy. A MapML document can define an extent that indirectly defines a "map" origin. Nevertheless, the map extent might be changed by the context in which the MapML is loaded; e.g. the HTML "map" element. This leaves us with the "tcrs" coordinates that are pixel-based coordinates with a fix origin in the origin of the tiled space. This ER suggests inclusion of an attribute in the geometrical part of each feature that indicates the type of Coordinate System with all possible values of the current input@units (even if "map", "tilematrix" and "tile" are not recommended). Possible MapML encoding of a feature expresed in TCRS coordinates units tcrs 123 321 122 322
7.3. Encoding attributes in features After examining the geometrical part of the features, this ER now concentrates on the attribute part. There is some consensus on the convenience of using HTML to express attributes ready to visualize. This has the issue of machine readability of the information contained in the HTML fragment. The suggestion is to use schema.org encodings to enable that. 7.3.1. Encoding feature properties with Microdata. Three alternatives are presented below. All three rely on the use of microdata to specify the non-geometrical properties of the feature. The way they encode geometry is different. Note Please note that in this chapter there is no suggestion to use the GeoShape elements included in schema.org. The authors of this ER consider that the geoshape element has been oversimplified. It can be useful to report the approximate position of a resource to a web crawler but it cannot substitute an accurate description of the coordinates of the features. 7.3.2. Alternative 1: Compact geometry encoding with microdata This encoding is departing from the general feature model where a feature can have geometrical and non-geometrical properties at the same level. Instead, it assumes that the content of a feature is characterized by its geometrical properties first and non-geometrical properties can be attached to it as sub-properties, in the same way that GeoJSON does. The advantage of this approach is that we can attach non-geometrical properties to the complete geometry but also to any part of it. In this encoding, root feature elements are named , …. Inside these elements, HTML text is included describing the feature. Schema.org encoded in microdata is introduced to tag the HTML text with semantics. In addition, the linearRing element, that includes the coordinates of the polygon, is also introduced. The style of the polygon applies to all linearRings but can be overwritten by them if a style is applied to a linearRing directly. It is assumed that the style does not apply to the non-geometrical properties that should define their one styles. Example of a polygon encoding id myrestaurant style fill red stroke black stroke-width opacity 0.5 itemscope itemtype boundary exterior 123,321 124,322 126,322 123,321
itemprop name Fondue for Fun and Fantasy
itemprop description Fantastic and fun for all your cheesy occasions.
Open: itemprop openingHours content Mo,Tu,We,Th,Fr,Sa,Su 11:30-23:00 Daily from 11:30am till 11pm
The following example shows how non-geometrical properties can be added to an inner ring. Example of a polygon with a ring of a different color and additional non-geometrical properties. id myrestaurant style fill red stroke black stroke-width opacity 0.5 itemscope itemtype
itemprop name Fondue for Fun and Fantasy
itemprop description Fantastic and fun for all your cheesy occasions.
Open: itemprop openingHours content Mo,Tu,We,Th,Fr,Sa,Su 11:30-23:00 Daily from 11:30am till 11pm
7.3.3. Alternative 2: Compact geometry encoding with microdata This encoding is more similar to the GeoJSON alternative and separates, in a clearer way, the geometric and non-geometric characteristics. An example of a polygon encoding is shown below. Example of a polygon encoding id myrestaurant itemscope itemtype
itemprop name Fondue for Fun and Fantasy
itemprop description Fantastic and fun for all your cheesy occasions.
Open: itemprop openingHours content Mo,Tu,We,Th,Fr,Sa,Su 11:30-23:00 Daily from 11:30am till 11pm
id MyRestaurantGeometry style fill red stroke black stroke-width opacity 0.5 itemscope itemtype boundary exterior 123,321 124,322 126,322 123,321
7.3.4. Alternative 3: GML geometry encoding with microdata The following encoding reuses GML geometrical classes to encode the geometrical properties. In this case, there is neither namespace nor GML schema but only the reuse of the GML encoding of geometrical features. The need for defining feature types a priori is eliminated. The resulting notation is comparable to other alternatives in terms of complexity and size. Since GML validation has been relaxed, GML elements can be considered extensible and attributes and elements added when needed. One of the additions is the inclusion of styles to represent how the objects need to be portrait in the screen. In the following examples, the style property is used. Other approaches can also be used to associate styles to elements in HTML such as the use of "class" names or the association of styles to element id’s. Note The use of SVG (css) styles in GML is not new and was introduced in GML 3.0.0 and is still present in the informative annex H in GML 3.2.1 (OGC 07-036). Nevertheless, the encoding suggested here is different and based on how HTML links elements with css styles. Example of a polygon encoding id myrestaurant style stroke black stroke-width opacity 0.5 itemscope itemtype
itemprop name Fondue for Fun and Fantasy
itemprop description Fantastic and fun for all your cheesy occasions.
Open: itemprop openingHours content Mo,Tu,We,Th,Fr,Sa,Su 11:30-23:00 Daily from 11:30am till 11pm
id MyRestaurantGeometry style fill lime stroke black stroke-width opacity 0.5 itemscope itemtype 123 321 124 322 126 322 123 321
In this example, the relaxation of GML validation is used to include new style attributes to an inner ring and to add non-geometrical properties to it. Example of a polygon encoding with holes id myrestaurant style stroke black stroke-width opacity 0.5 itemscope itemtype
itemprop name Fondue for Fun and Fantasy
itemprop description Fantastic and fun for all your cheesy occasions.
Open: itemprop openingHours content Mo,Tu,We,Th,Fr,Sa,Su 11:30-23:00 Daily from 11:30am till 11pm
If this approach is taken, extensions that are allowed should be detailed in the specification. Moreover, some addition to the set of GML geometrical objects is needed, such as the addition of ellipses. 7.4. MapML in relation to vector tiles Recently, some vendors (such as Mapbox, Google, etc) have produced encodings for vector tiles. There is no consensus of a transversal or interoperable encoding yet, what currently makes vector tiles an 'unknown media type' as far as the browser is concerned. As such, they are handled by the JavaScript layer (e.g. a leaflet plug-in), not by the web browser engine, except e.g. for the canvas API calls that might be done by the JavaScript library. In this respect, vector tiles are even less portable than PNG tiles, since for the latter the web browser engine 'understands' how to layout and paint picture formats. The main advantage of vector tiles is bandwidth conservation, which is important, but it is not the first main goal in standardization of geospatial concepts in the web browser. MapML does not overlap or duplicate the role of vector or raster tiles. However, a MapML client engine, whether it was implemented in JavaScript or Web Assembly, or preferably by the web browser, could use vector data, (instead of, or in addition to raster tiles) to paint a map layer. To adopt vector tiles, the main barrier is the standardization of the vector tile format to the point where it is widely understood and implemented as a PNG. Finally, despite the canvas element, vector tiles styling is done by scripting, because vector tiles are not included in the DOM, hence they are not susceptible to styling via CSS. 8. CCS Symbolization Cascading Style Sheets (CSS) describes how HTML elements are to be displayed on screen. A CSS document comprises a sequence of rule-sets that consist of two parts: The selector, that points to the HTML element to be symbolized. This element should be part of the DOM of the HTML. This excludes styling geometrical features rendered in a canvas element. The declaration block that contains one or more symbol declarations Example of a ruleset in CSS color red text-align center In the example above, the selector points to all
elements and declares that letters will be in red and sentences will be centered for all paragraphs in the HTML page. CSS rule-sets can be provided in an HTML page by: including in a class nice ...
Things start to be more interesting when we use a characteristic in CSS that allows for selecting elements to be symbolized depending on the values of some attributes of the element.
type road ...
CSS has selectors that can be used to select element tag names, class attributes or elements id’s. An interesting capability is that selectors can be used to select whatever element name that has an attribute (using the '*' character).
type road road
As suggested by , this can be used for semantic tagging in schema.org microdata to define the symbolization of elements that has a particular semantic annotation. This means it can be used to select features that have a particular property. In practice, if features are tagged with microdata, then elements of a particular itemtype can be selected. Going further in this approach, itemtype’s that are in a particular scope can be selected. The authors of this ER have not been able to find anyone suggesting that, but it is what you should do if you want to be precise in your selectors. This approach was already mentioned in OGC 16-053r1 [ ].
itemscope itemtype itemprop type road
Exploring all these possible combinations together, and analyzing what is possible in CSS, some important limitations in CSS were found that prevent developers from doing things that are common in GIS such us conditioning the style of a geometry to some values of the properties or specifying a style declaration value as a function of a property value. 8.2. Limitations in CSS In the experimentation done to apply CCS to features with properties and geometry, the following limitations were detected: You cannot select an element of the HTML and apply the symbol to another element You cannot set a selector based on the value of the element (you can do it based on an attribute of the element) You cannot set a selector based on the value of two properties at the same level. You cannot set a symbol declaration value (e.g. width ) as a function of a value of an element or attribute in the HTML Some experts suggest that the limitations in the selectors syntax were imposed on purpose to limit complexity of the parses and to allow a faster parsing of the HTML-CSS styler. 8.2.1. You cannot set a selector based on the value of the element. CSS selectors can only select elements-based attributes but not on element values (a.k.a. element innerHTML). The use of the attribute "content" of microdata could be a fix to this limitation even if the value has to be repeated.
class table-properties itemscope itemtype
scope row id
itemprop id 10964418e33d457aabd6f6ab10dc2e4a
scope row theme
itemprop theme content road road
To avoid the need to repeat the content as an attribute and as a value, you could use CSS content property as suggested here: . In the following example, the innerHTML span element is populated with the content of the content attribute using the CSS declaration content. Unfortunately, this solution requires a complex notation that does not favors clarity.
itemscope itemtype itemprop theme content highway
8.2.2. You cannot set select an element of the HTML and apply the symbol to another element In principle, CSS was not designed to select some elements but to apply the style to another element. In our case, this means that in general it is not possible to define a selector depending on "properties" and apply this to "geometry". The only approximation to this behavior is to select the polygon that is a child of geometry that has a precedent sibling (using ~) with an attribute value.
type road
polygon
The use of JavaScript can help to overcome this limitation. The function querySelectorAll can be used to make use of selector of properties and className to apply the style to geometries.
onLoad setColorsToGeometries()
class table-properties itemscope itemtype
scope row theme
itemprop theme content road road
8.3. Extensions of CSS to support geospatial requirements One of the extensions needed the capability to apply a selector based on some properties values to the geometry . The authors of this ER propose to incorporate condition1 attribute to point another selector that will add extra conditions based on elements that are not directly the ones to symbolize. Both the selector and the condition1 should be of the same father. A suggested possibility is:
class table-properties itemscope itemtype
scope row id
itemprop id 10964418e33d457aabd6f6ab10dc2e4a
scope row theme
itemprop theme content road road
Another extension could be to condition a declaration value (e.g. width) to a property value (e.g. lanes). This could be achieved by using a selector as a value of a symbol declaration:
class table-properties itemscope itemtype
scope row id
itemprop id 10964418e33d457aabd6f6ab10dc2e4a
scope row theme
itemprop theme content road road
scope row theme
itemprop name content route 66 Route 66
scope row theme
itemprop lanes content
Note More work on the use of CSS styling for geospatial objects can be found here: A hands-on tutorial from GeoSolutions training materials: The GeoServer documentation getting started tutorial: The GeoServer "cookbook": The GeoServer Full list of supported properties: Full contents with more links here: and also in 8.4. Selecting alternative styles for MapML This subsection assumes that CSS rule-sets are provided in an independent CSS file and linked from the MapML page. There are two practical ways that emerged from the experiments done during OGC Testbed-14, which support a use case giving the opportunity to the user to select among a list of styles for the "same" map content. One approach is to use the link rel approach to indicate that there are other alternative styles related to the same map available. This can be done by using the link/@rel=style to indicate alternative styles that will have a title and an href to another MapML document. The style currently in use can be tagged as "self style". MapML fragment that includes references to two styles (the one with rel=self is the current one), a reference to a legend and a reference to an alternative projection. rel self style title CubeWerx href /> rel style title Red Example href /> rel legend href /> rel alternate projection CBMTILE href /> In a client, alternative styles can be expected to result in alternative presentations available in the legend (e.g. as a drop-down selector or a group of radio buttons) Figure 4. Visualization of alternative styles a radio buttons in the legend. Note Alternative stylesheets Do not get confused with a similar but almost forgotten functionality introduced in HTML 4.0 that allows defining alternative stylesheets (alternative CSS) in HTML documents ( ). These alternative styles were available through the web browser menu only in Firefox and Internet Explorer. Since the menu has been hidden in major web browsers it has become completely unknown.
With the recent introduction of selectors and URL templates in MapML, there might be other ways of achieving the exact same functionality. Actually, there are 2 similar ways of implementing a selector. The first one involves considering the style name as a parameter in the URL template and using a select instead of an input. Alternative encoding for alternative styles.
units OSMTILE method get
... rel tile tref />
The second one involves considering the style name as a parameter in the URL template and using a datalist as a selector. Alternative encoding for alternative styles.
units OSMTILE method get name Style list styles />
... rel tile tref />
Warning MapML should decide which is the right way of doing selectors. In the authors opinion, a selector should be implemented as a