Skip to content

Releases: GEOLYTIX/xyz

v1.4.2 Update (04/01/2019)

03 Apr 12:01
Compare
Choose a tag to compare

Release Update v1.4.2 - April 01 2019

Fixes

  • Date Picker on Chrome fix

Changes

  • No result alert added on Output.

v1.4.1 Update (03/25/2019)

26 Mar 07:06
Compare
Choose a tag to compare

Release Update v1.4.1 - March 25 2019

Fixes

  • Fix to mvts - Layer reloaded after applying theme.
  • Filtering bug.
  • Zero Config Bug

Changes

Reports
  • Checks layers to display
  • Use HTML template tags
  • Configurable Link Name
Charts
  • Tooltip position change ; position: 'average'
  • Charts size can be customized with a height: property
{
     "label": "Sales",
      "type": "group",
      "chart": {
      "active": true,
      "height": 400,
     "xAlign": 0,
     "yAlign": 10,
    "type": "bar",
    "backgroundColor": [
      "#FFA630",
     ],
     "borderColor": [
           "#FFA630",
        ],
         "stacks": [
        "Actual Sales",
        "Model Sales"
     ]
   }
}

v1.4.0 Update (03/11/2019)

18 Mar 12:20
Compare
Choose a tag to compare

Release Update v1.4.0 - March 11 2019

Fixes

  • The group symbol to show / hide layers in a group was bugged. This is fixed in this branch.

  • Streetview control in location view is now created with hyperHTML. Does no longer break table columns.

  • Empty groups are now hidden in location view.

  • Fix for filters. Current filter must be assigned to legend filter not the other way around.

  • Zoom to layer extent will now use filter.

Changes

  • Set zindex for svg in panes to 100 to prevent polygons drawn on top of images.
.leaflet-map-pane svg {
    z-index: 100;
}
  • Image control is no longer vertical with scroll but column.

  • Images are uploaded automatically.

  • Location geometries are drawn on the same pane.

  • The pane can be supplied as a style property to the location draw method.

  • New mvts cache tables will only have a spatial index. The x,y,z index should not be necessary due to the primary key.

Reports

Currently only one report.

Template: public/views/report.html
Script: public/js/views/report.js

Endpoint: routes/report.js

  • The report endpoint will check for token and require login for private endpoints if the token is not supplied in URL.

  • The report script stores URL param as report_params object.

  • The report is an infoj field type: report which will create a link to the report endpoint with URL params.

  • The report template has viewmode 'report' on the body. Locations will not be editable if the viewmode is report. * Cluster are not selectable if the viewmode is report.

  • Location table entries and the report button itself will not be shown in the report view.

  • hideInReport : true fields will return immediately from the view update if the viewmode is 'report'.

Location Table Charts

Addition of charts to represent data for a Table Definition.

   "chart": {
       "type": "horizontalBar",
        "active": true,
         "field": "age_index"
      }

v1.3.1 Update (03/04/2019)

04 Mar 10:06
Compare
Choose a tag to compare

Release Update v1.3.1 - March 4 2019

Bug Fix

  • Gazetteer
function createFeature(geom) {

  // Parse json if geom is string
    geom = typeof (geom) === 'string' ? JSON.parse(geom) : geom;

    // Remove existing layer.
    if (_xyz.gazetteer.layer) _xyz.map.removeLayer(_xyz.gazetteer.layer);

    _xyz.gazetteer.layer = _xyz.mapview.draw.geoJSON({
      json: geom,
      pane: 'gazetteer',
      style: {
        icon: {
          url: _xyz.gazetteer.icon,
          size: 40,
          anchor: [20, 40]
        }
      }
    });

    // Zoom to the extent of the gazetteer layer
    _xyz.map.fitBounds(_xyz.gazetteer.layer.getBounds());
  }

Included Style object to Create Feature

v1.3.0 Update (03/01/2019)

04 Mar 08:31
Compare
Choose a tag to compare

Release Update v1.3.0 - March 1 2019

Changes

Update leaflet to version 1.4.0.

_xyz() instantiation will load the first locale if no locale is specified as parameter.

_xyz() instantiation will async load the workspace if no callback is defined.

Async instantiation:

const xyz = await _xyz({
    host: document.head.dataset.dir
});

Instantiation with callback:

_xyz({
  host: document.head.dataset.dir
  callback: xyz => {}
})

_xyz.workspace.loadLocale() will load a locale from the workspace.

_xyz.workspace.loadLocale({
    locale: 'GB'
});

_xyz.mapview.create() will load a locale if the locale parameter is given as parameter.

utils.paramstring() will not add empty keys to output.

utils.createCheckbox() returns the input.

utils.getCircularReplacer() Replace circular reference when stringyfying JSON.

utils.dataURLtoBlob() Return Blob from dataURL.

utils.turf.pointOnFeature() Return [lat, lng] coordinate pair from a point in polygon. Will also work with point geometry.

hooks.remove() will empty but not remove array hooks.

select hooks are retired.

locations are now stored in hooks.current.locations[].

The location hook will be removed if a location cannot be selected.

hooks.set() uses now Object.assign instead of a single key/value pair.

The _xyz.hooks object is structured as follows:

hooks : {
    current : {
        layers : [],
        locations : []
    },
    filter : ()=>{},
    push : ()=>{},
    remove : ()=>{},
    removeAll : ()=>{},
    set : ()=>{},
}

mapview.draw.geoJSON({})

Drawing GeoJSON to the map is now a drawing method on the mapview.

mapview.popup()

Will open a popup on the mapview. Content and latlng must be supplied as input param.

Locations

_xyz.locations has a select() method as well as location prototype object.

Calling _xyz.locations.select() with input parameters will create a location and get it's data from the XYZ middleware.

Without a mapview and no callback the select method will create an alert with the stringified infoj object.

With a mapview the location will be drawn to the map and a popup with the location view will be displayed.

A callback can be passed to the select method to control the display of the location view.

_xyz.locations.select(
  //params
  {
    locale: 'NE',
    dbs: 'XYZ',
    layer: 'COUNTRIES',
    table: 'dev.natural_earth_countries',
    id: 80,
  },
  //callback
  location=>{
    location.style.fillColor = '#f44336';
    location.style.fillOpacity = 1;
    location.draw();
    document.getElementById('location_info_container2').appendChild(location.view.node);
  }
);

location.draw() will draw the location to the mapview.

A location's own methods know their parent.

location.draw(), location.remove(), etc. do not need the location object as input parameter.

locations : {
    select : {},
    location : {
        infoj : [],
        geometry : {},
        Geometry : {},
        marker : {},
        Marker : {},
        geometries : [],
        remove : ()=>{},
        get : ()=>{},
        draw : ()=>{},
        view : {
            update : {},
            node : {},
            geometry : {
                ctrl : {
                    isoline_here : ()=>{},
                    isoline_mapbox : ()=>{},
                    delete_geom : ()=>{},
                    show_geom : ()=>{},
                    hide_geom : ()=>{},
                }
            },
            group : {},
            groups : {},
            streetview : ()=>{},
            images : {
                ctrl : {
                    add_image : ()=>{},
                    delete_image : ()=>{},
                    upload_image : ()=>{},
                },
            }
        }
    }
}

Addition of Table Definition

A selected location may have its own table view presenting relevant data. The visibility of the location can be toggled on and off.

image

The data is calculated against various additional geometries that are associated with the location. They can use values calculated within subqueries as well as fixed expressions not related spatially.

"infoj": [
  {
    "type": "tableDefinition",     // defines table
    "title": "Age Profile",        // required and unique within infoj
    "columns": [],
    "rows": [],
    "agg": []                      // optional
  }
]

title is required and must be unique.

tableDefinition has three children : columns, rows and agg

v1.2.1 Update (02/12/2019)

25 Feb 15:33
Compare
Choose a tag to compare

Release Update v1.2.1 - February 12 2019

Changes

Attribution (Versioning)

Version Numbering added into _default.json workspace.

"attribution": {
        "XYZ #v1.2.1": "https://github.com/geolytix/xyz#v1.2.1",
        "Leaflet": "https://leafletjs.com"
    },

Table View
Table View Functionality Added

         "tableview": {
                        "tables": {
                            "Retail Places": {
                                "columns": [
                                    {
                                        "label": "ID",
                                        "field": "id",
                                        "type": "text"
                                    },
                                    {
                                        "field": "dev_date",
                                        "type": "date"
                                    },
                                    {
                                        "field": "rp_type",
                                        "type": "text"
                                    }
                                ]
                            }
                        }
                    }

Bug Fixes

  • Date Fields not appearing on Filtering

v1.2.0 Update (02/04/2019)

07 Feb 15:54
Compare
Choose a tag to compare

Release Update v1.2.0 - February 04 2019

Changes

Aggregate Function

  • The aggregate function must be part of the function if "fieldfix": is defined.
  • If not defined the aggregate function must form part of the "lookup":
{
  "label": "OA pop_11",
  "field": "pop_11_",
  "type": "integer",
  "lookup": {
    "table_a": "dev_polygons",
    "geom_a": "a.geom",
    "table_b": "schema.dev_points",
    "geom_b": "b.geomcntr",
    "condition": "ST_INTERSECTS",
    "aggregate": "AVG"
  }
}

(Aggregate Defined in Look Up)

{
  "label": "Population Growth % (2011-17)",
  "field": "pop_growth_11_17_5min",
  "fieldfx": "SUM(b.pop__17 - b.pop__11) * 100 / SUM(b.pop__11)",
  "type": "numeric",
  "lookup": {
      "table_a": "schema.table_a",
      "table_b": "schema.table_b",
      "geom_a": "isoline_5min",
      "geom_b": "geomcntr"
  }
}

(Aggregate Function defined in the Function Field)

v1.1.1 Update (01/30/2019)

30 Jan 07:19
Compare
Choose a tag to compare

Release Update v1.1.1 - January 30 2019

New

Additional Geometries
Geometries are now attached to selected locations.

image

  • UI Improvements for Live geometries creation, optional hiding for fixed additional geometries.

image

  • Improved lookup query - added result control
  • Minor improvements to Location table styling
  • Fix to grid endpoint - lat/long now extracted from geom

Bug Fixes

  • Image Upload now requires dbs

v1.1.0 Update (01/28/2019)

28 Jan 12:39
Compare
Choose a tag to compare

Release Update v1.1.0 - January 28 2019

New

Leaflet control

The Leaflet control can be instantiated with the init command which returns an XYZ instance with a map object assigned. A callback provided to the init will pass the XYZ instance as single argument.

The default interface view uses the map control as a single instance. Switching the locale re-initializes the Leaflet control.

A default view can be defined for locales.

locale.view: {
      "lat": 45,
      "lng": 60,
      "z": 3
    }

locale.maskBounds = true masks the bounds defined for the locale.

Styles can have a selected style which is set when a location is selected. This is style is empty by default.

locale.showScaleBar = true shows a scalebar in the map view.

Fixes

  • Selection of cluster locations.

  • SVG Letter marker in Firefox.

Behavioural Changes

format: "geojson" layer are now cached and will only reload if required. Viewport bounds are ignored for geojson layer.

The circle marker is no longer shown for selected point locations.

v1.0.0

03 Dec 14:13
9ae76ad
Compare
Choose a tag to compare

Rebase from RC1 branch.