Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GEOT-6494] MBStyle extension #2743

Merged
merged 11 commits into from
Feb 13, 2020
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/user/build/maven/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ If you are having problems with logging output levels be sure to read the loggin
Test Coverage
^^^^^^^^^^^^^

You can use maven to measure test coverage::
Maven jacoco report is configured and available using::

mvn -o clean cobertura:cobertura
mvn test site

The resulting report is located in :file:`target/site/cobertura/index.html``.
The resulting report is located in :file:`target/site/jacoco/index.html``.

Online Testing
^^^^^^^^^^^^^^
Expand Down
5 changes: 3 additions & 2 deletions docs/user/extension/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ Extensions build additional functionality on top of the core services of the Geo
complex
graph/index
grid
mbstyle/index
ogc/index
wms/index
tile-client/index
transform/transform
wms/index
wmts/index
validation
xsd/index
transform/transform
ysld

Extensions build on top of the core concepts provided by the GeoTools library. This allows the project to take on more general topics than just being a simple geospatial library.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Mapbox Styles Module
The ``gt-mbstyle`` module is an unsupported module that provides a parser/encoder to convert between Mapbox Styles and GeoTools style objects. These docs are under active development, along with the module itself.

.. toctree::
:maxdepth: 1
:maxdepth: 2

spec
spec/index

References:

* https://www.mapbox.com/mapbox-gl-style-spec
* `MapBox Style Specification <https://www.mapbox.com/mapbox-gl-js/style-spec/>`__

Code Example
^^^^^^^^^^^^
Expand All @@ -34,7 +34,7 @@ Internally the extension provides greater access to the parsed style:
// pull back selected layers for a provided source
List<MBLayer> layers = mbstyle.layers( "sf:roads" );

//Which can be used to Generate a List of FeatureTypeStyles:
// Which can be used to Generate a List of FeatureTypeStyles:
List<FeatureTypeStyle> fts = layer.transform( style );


Expand All @@ -43,18 +43,19 @@ Zoom level tuning

The mapping between zoom levels and scale denominators is performed assuming, by default, a 512 pixels
root tile at zoom level zero. This matches the usage of vector tiles client side.
If a different value is to be used, it's possible to set a system variable to change the default.
If a different value is to be used, it's possible to set a system property to change the default.
E.g., the following would match "x4" tiles:

.. code-block:: java

System.setSystemProperty("MBSTYLE_ROOT_TILE_PIXELS", "1024")
System.setSystemProperty("MBSTYLE_ROOT_TILE_PIXELS", "1024")

MapBox Types
^^^^^^^^^^^^
copied from the `MapBox Style Specification <https://www.mapbox.com/mapbox-gl-js/style-spec/>`_

Color
Quoting `MapBox Style Specification <https://www.mapbox.com/mapbox-gl-js/style-spec/>`__ :

``Color``
Copy link
Member Author

@jodygarnett jodygarnett Feb 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tbarsballe this section has some duplication with spec/types.rst, do you know any background to untangle?

Reading the content, it looks like this was an earlier summary of the specification

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spec/*.rst is a direct copy of the MapBox spect with GeoTools supported version added.
This index page tries to provide a more concise overview / quickstart, and pulls some of the more top-level information from the spec. It could maybe do with some rewording, but should still keep all that info in it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I removed the duplication, and made this focus on the example snippets


Colors are written as JSON strings in a variety of permitted formats: HTML-style hex values, ``rgb``, ``rgba``, ``hsl``, and ``hsla``. Predefined HTML colors names, like ``yellow`` and ``blue``, are also permitted.

Expand Down
27 changes: 27 additions & 0 deletions docs/user/extension/mbstyle/spec/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright (c) 2016, Mapbox

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of Mapbox GL JS nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading