Giter VIP home page Giter VIP logo

Comments (3)

nyurik avatar nyurik commented on July 18, 2024

If we want the minimum changes, I think we should simply replace language-strings with multilingual objects. E.g. the v2/manifest would only need attribution localized (note that URLs might also be different for different languages)

{
  "services": [
    {
      "id": "road_map",
      "url": "https://tiles.maps.elastic.co/v2/default/{z}/{x}/{y}.png?elastic_tile_service_tos=agree&my_app_name=kibana",
      "minZoom": 0,
      "maxZoom": 10,
      "attribution": {
        "en": "© [OpenStreetMap](http://www.openstreetmap.org/copyright) contributors | [Elastic Maps Service](https://www.elastic.co/elastic-maps-service)",
        "fr": "..."
    }
  ]
}

For a more thorough update, which would also speed up things a bit, we may need to put all of the available tiles and ems files into a single catalogue. Note that we should re-download that catalogue in each browser session to avoid our previous caching issues.

{
  "version": "v7",
  "id": "catalogue",
  "base-maps": [
    {
      "id": "road_map",
      "raster": "http://tiles../raster/style.json",   // <-- this could in some cases also be per lang object
      "vector": "http://tiles../vector/style.json",  // <-- same
      "name": {
        "en": "...",
        "fr": "..."
      },
      "description": {
        "en": "...",
        "fr": "..."
      }
    }
  ],
  "emsfiles": [
    {
      "id": "us_states",
      "geojson": "http://vector../...geo.json",
      "topojson": "http://vector../...topo.json",
      "name": {
        "en": "...",
        "fr": "..."
      },
      "description": {
        "en": "...",
        "fr": "..."
      }
    }
  ]
}

from ems-file-service.

nickpeihl avatar nickpeihl commented on July 18, 2024

@elastic/kibana-gis

Yuri and I drafted a new proposed structure for the v6.6 tile and vector manifests. This will require changes to region maps and tile maps in Kibana. Please review and share your thoughts.

In the vector manifest we nix the weight, id, and tags properties. weight is unnecessary since the layers array is already ordered. The tags property was never used and the id property which was a random string of numbers is no longer used.

A new layer_id property is used to uniquely reference the layer in the manifest (previously we used name). name is now an object of language codes to select the appropriate display label in the select box in Kibana.

attribution is a localized property, although translations may not be available/necessary and we may only ever use en. attribution.en is an array of objects defining the label and url where we previously used a Markdown string (#27).

The format property is replaced by formats which is an array of objects that could define multiple file formats (GeoJSON, TopoJSON, etc) for a single layer. The formats[].url is changed to /files/<filename> instead of /blob/<id_number>.

Fields have a new type property that is either id or property to discourage the use of joining to a region name (#47). fields[].name is changed to fields[].id and fields[].description is changed to fields[].label, an object of language codes to select the appropriate display label in the Kibana select box.

Here's a diff comparing the proposed v6.6 to v2 vector manifests.

--- current-manifest	2018-11-07 14:33:11.000000000 -0800
+++ manifest-propsal	2018-11-07 14:34:32.000000000 -0800
@@ -1,28 +1,64 @@
 {
   "layers": [
     {
-      "weight": 1,
+      "layer_id": "world_countries",
       "created_at": "2017-04-26T17:12:15.978370",
-      "attribution": "[Made with NaturalEarth](http://www.naturalearthdata.com/about/terms-of-use)|[Elastic Maps Service](https://www.elastic.co/elastic-maps-service)",
-      "url": "https://vector-staging.maps.elastic.co/blob/5659313586569216?elastic_tile_service_tos=agree",
-      "format": "geojson",
+      "attribution": {
+        "en": [
+          {
+            "label": "Made with NaturalEarth",
+            "url": "http://www.naturalearthdata.com/about/terms-of-use"
+          },
+          {
+            "label": "Elastic Maps Service",
+            "url": "https://www.elastic.co/elastic-maps-service"
+          }
+        ]
+      },
+      "formats": [
+        {
+          "format": "geojson",
+          "url": "https://vector-staging.maps.elastic.co/files/world_countries_v1.geo.json?elastic_tile_service_tos=agree"
+        }
+      ],
       "fields": [
         {
-          "name": "iso2",
-          "description": "Two letter abbreviation"
+          "type": "id",
+          "id": "iso2",
+          "label": {
+            "en": "Two letter abbreviation",
+            "de": "...",
+            "zh": "...",
+            ...
+          }
         },
         {
-          "name": "iso3",
-          "description": "Three letter abbreviation"
+          "type": "id",
+          "id": "iso3",
+          "label": {
+            "en": "Three letter abbreviation",
+            "de": "...",
+            "zh": "...",
+            ...
+          }
         },
         {
-          "name": "name",
-          "description": "Country name"
+          "type": "property",
+          "id": "name",
+          "label": {
+            "en": "Country name",
+            "de": "...",
+            "zh": "...",
+            ...
+          }
         }
       ],
-      "tags": [],
-      "id": 5659313586569216
-      "name": "World Countries",
+      "name": {
+        "en": "country",
+        "de": "Staat",
+        "zh": "国家",
+        ...
+       }
     },
     ...
   ]

The tiles manifest for v6.6 replaces the top level services property with more appropriate styles.

name is a new property which is an object of language codes to select the appropriate label for the select box in kibana (kibana/#17267).

formats is an array of objects defining the tile service formats (format:raster and format:vector) and the respective url for the style.json (#8). The style.json document contains the url for the service (e.g. /{z}/{x}/{y}.[png,pbf]).

minZoom, maxZoom, and attribution have been removed from the manifest because they are defined in the style.json.

{
  "styles": [
    {
      "id": "road_map",
      "name": {
        "en": "Road Map - Bright"
      },
      "formats": [
        {
          "format": "raster",
          "url": "http://tiles.maps.elstc.co/styles/positron/style.json"
        },
        {
          "format": "vector",
          "url": "http://tiles.maps.elstc.co/styles/positron.json"
        }
      ]
    },
    {
      "id": "dark-matter",
      "name": {
        "en": "Road Map - Dark"
      },
      "formats": [
        {
          "format": "raster",
          "url": "http://tiles.maps.elstc.co/styles/dark-matter/style.json"
        },
        {
          "format": "vector",
          "url": "http://tiles.maps.elstc.co/styles/dark-matter.json"
        }
      ]
    },
    ...
  ]
}

from ems-file-service.

nickpeihl avatar nickpeihl commented on July 18, 2024

Localization was merged in #60.

from ems-file-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.