Skip to content
This repository has been archived by the owner on Oct 27, 2022. It is now read-only.

Commit

Permalink
0.1.2 patch release (#28)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan Stichbury <2533428+nzjony@users.noreply.github.com>
  • Loading branch information
nzjony committed Sep 15, 2020
1 parent 144d6b0 commit fbb7517
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 157 deletions.
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@here/harp-map-editor",
"version": "0.1.1",
"version": "0.1.2",
"description": "A simple online editor for harp.gl themes.",
"author": {
"name": "HERE Europe B.V.",
Expand Down Expand Up @@ -31,11 +31,10 @@
},
"devDependencies": {
"@here/harp-font-resources": "~0.2.4",
"@here/harp-map-controls": "~0.17.0",
"@here/harp-map-theme": "~0.17.0",
"@here/harp-mapview": "~0.17.0",
"@here/harp-omv-datasource": "~0.17.0",
"@types/jszip": "^3.1.6",
"@here/harp-map-controls": "~0.19.0",
"@here/harp-map-theme": "~0.19.0",
"@here/harp-mapview": "~0.19.0",
"@here/harp-vectortile-datasource": "~0.19.1",
"@types/react": "^16.8.18",
"@types/react-dom": "^16.8.4",
"@types/react-json-tree": "^0.6.11",
Expand All @@ -55,7 +54,7 @@
"react-json-tree": "^0.11.2",
"sass-loader": "^8.0.0",
"style-loader": "^1.0.0",
"three": "^0.117.1",
"three": "^0.119.0",
"throttle-debounce": "^2.1.0",
"ts-loader": "^7.0.5",
"tslint": "^6.1.2",
Expand Down
4 changes: 2 additions & 2 deletions src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
* Licensed under Apache 2.0, see full license in LICENSE
* SPDX-License-Identifier: Apache-2.0
*/
import { OmvTileDecoderService } from "@here/harp-omv-datasource/index-worker";
import { VectorTileDecoderService } from "@here/harp-vectortile-datasource/index-worker";

OmvTileDecoderService.start();
VectorTileDecoderService.start();
4 changes: 2 additions & 2 deletions src/map-editor/components-smart/PopupCreateTechnique.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under Apache 2.0, see full license in LICENSE
* SPDX-License-Identifier: Apache-2.0
*/
import { ResolvedStyleDeclaration } from "@here/harp-datasource-protocol";
import { Style } from "@here/harp-datasource-protocol";
import { Expr } from "@here/harp-datasource-protocol/lib/Expr";
import * as React from "react";
import { GeometryType, TechniqueData, Techniques } from "../../types";
Expand Down Expand Up @@ -80,7 +80,7 @@ export default class extends Component<Props, State> {
attr: {},
};

switch (MapHandler.addStyleTechnique(style as ResolvedStyleDeclaration)) {
switch (MapHandler.addStyleTechnique(style as Style)) {
case "err":
PopupsContainer.alertPopup("Error", "Can't create style.");
break;
Expand Down
12 changes: 6 additions & 6 deletions src/map-editor/map-handler/MapGeometryList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import { MapEnv } from "@here/harp-datasource-protocol/index-decoder";
import { GeoCoordinates, mercatorProjection, webMercatorTilingScheme } from "@here/harp-geoutils";
import { MapView } from "@here/harp-mapview";
import { DataProvider } from "@here/harp-mapview-decoder";
import { OmvDataSource } from "@here/harp-omv-datasource";
import { OmvProtobufDataAdapter } from "@here/harp-omv-datasource/lib/OmvData";
import { VectorTileDataSource } from "@here/harp-vectortile-datasource";
import { OmvDataAdapter } from "@here/harp-vectortile-datasource/lib/adapters/omv/OmvDataAdapter";

import { DecodeInfo } from "@here/harp-omv-datasource/lib/DecodeInfo";
import { DecodeInfo } from "@here/harp-vectortile-datasource/lib/DecodeInfo";
import {
IGeometryProcessor,
ILineGeometry,
IPolygonGeometry,
} from "@here/harp-omv-datasource/lib/IGeometryProcessor";
} from "@here/harp-vectortile-datasource/lib/IGeometryProcessor";
import { Vector2 } from "three";

//
Expand Down Expand Up @@ -88,13 +88,13 @@ async function dumpTile(
geometryList = {};
const buffer = (await dataProvider.getTile(tileKey)) as ArrayBuffer;
const decoder = new Decoder();
const adapter = new OmvProtobufDataAdapter(decoder);
const adapter = new OmvDataAdapter(decoder);

const decodeInfo = new DecodeInfo("dump", projection, tileKey, storageLevelOffset);
adapter.process(buffer, decodeInfo);
}

export const getGeometryData = (mapView: MapView, dataSource: OmvDataSource): void => {
export const getGeometryData = (mapView: MapView, dataSource: VectorTileDataSource): void => {
const geoPoint = new GeoCoordinates(
mapView.geoCenter.latitude % 180,
mapView.geoCenter.longitude % 180
Expand Down
12 changes: 6 additions & 6 deletions src/map-editor/map-handler/MapHighliter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { APIFormat, OmvDataSource } from "@here/harp-omv-datasource";
import { OmvTileDecoder } from "@here/harp-omv-datasource/lib/OmvDecoder";
import { APIFormat, VectorTileDataSource } from "@here/harp-vectortile-datasource";
import { VectorTileDecoder } from "@here/harp-vectortile-datasource/lib/VectorTileDecoder";
import { accessToken } from "../config";
import settings from "../Settings";
import MapHandler from "./index";

class MapHighlighter {
private m_activeWhereParam = "";
private m_highlightDataSource: OmvDataSource;
private m_highlightDataSource: VectorTileDataSource;

private m_style: any = {
when: "0",
Expand Down Expand Up @@ -46,14 +46,14 @@ class MapHighlighter {
};

constructor() {
this.m_highlightDataSource = new OmvDataSource({
this.m_highlightDataSource = new VectorTileDataSource({
name: "decorations",
baseUrl: "https://xyz.api.here.com/tiles/herebase.02",
apiFormat: APIFormat.XYZOMV,
styleSetName: "tilezen",
maxZoomLevel: 17,
maxDisplayLevel: 17,
authenticationCode: accessToken,
decoder: new OmvTileDecoder(),
decoder: new VectorTileDecoder(),
});
}

Expand Down
18 changes: 9 additions & 9 deletions src/map-editor/map-handler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under Apache 2.0, see full license in LICENSE
* SPDX-License-Identifier: Apache-2.0
*/
import { BaseStyle, ResolvedStyleDeclaration, Theme } from "@here/harp-datasource-protocol";
import { BaseStyle, Style, Theme } from "@here/harp-datasource-protocol";
import { MapControls } from "@here/harp-map-controls";
import {
CopyrightElementHandler,
Expand All @@ -12,9 +12,9 @@ import {
MapViewEventNames,
MapViewUtils,
} from "@here/harp-mapview";
import { APIFormat, OmvDataSource } from "@here/harp-omv-datasource";
import { OmvTileDecoder } from "@here/harp-omv-datasource/lib/OmvDecoder";
import { LoggerManager } from "@here/harp-utils";
import { APIFormat, VectorTileDataSource } from "@here/harp-vectortile-datasource";
import { VectorTileDecoder } from "@here/harp-vectortile-datasource/lib/VectorTileDecoder";
import { EventEmitter } from "events";
import { throttle } from "throttle-debounce";
import { WhenPropsData } from "../../types";
Expand Down Expand Up @@ -66,7 +66,7 @@ class MapHandler extends EventEmitter {
/**
* The current data source for the camera.
*/
private m_datasource: OmvDataSource | null = null;
private m_datasource: VectorTileDataSource | null = null;
private m_copyrights: CopyrightInfo[];
private m_copyrightHandler: CopyrightElementHandler | null = null;

Expand Down Expand Up @@ -175,14 +175,14 @@ class MapHandler extends EventEmitter {
this.m_mapViewState.azimuth
);

this.m_datasource = new OmvDataSource({
this.m_datasource = new VectorTileDataSource({
baseUrl: "https://xyz.api.here.com/tiles/herebase.02",
apiFormat: APIFormat.XYZOMV,
styleSetName: style || undefined,
maxZoomLevel: 17,
maxDisplayLevel: 17,
authenticationCode: accessToken,
copyrightInfo: this.m_copyrights,
decoder: new OmvTileDecoder(),
decoder: new VectorTileDecoder(),
});

this.m_copyrightHandler = CopyrightElementHandler.install(
Expand All @@ -206,7 +206,7 @@ class MapHandler extends EventEmitter {
});

this.onMovementFinished = () => {
getGeometryData(this.m_mapView as MapView, this.m_datasource as OmvDataSource);
getGeometryData(this.m_mapView as MapView, this.m_datasource as VectorTileDataSource);
};
}

Expand Down Expand Up @@ -273,7 +273,7 @@ class MapHandler extends EventEmitter {
.join(" && ");
}

addStyleTechnique(style: ResolvedStyleDeclaration): AddStyleTechniqueResult {
addStyleTechnique(style: Style): AddStyleTechniqueResult {
const theme = textEditor.getParsedTheme();
const currentStyle = settings.get("editorCurrentStyle");

Expand Down
4 changes: 2 additions & 2 deletions src/text-editor-frame/TextEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under Apache 2.0, see full license in LICENSE
* SPDX-License-Identifier: Apache-2.0
*/
import { ResolvedStyleDeclaration } from "@here/harp-datasource-protocol";
import { Style } from "@here/harp-datasource-protocol";
import { Expr } from "@here/harp-datasource-protocol/lib/Expr";
import { EventEmitter } from "events";
import * as monaco from "monaco-editor";
Expand Down Expand Up @@ -184,7 +184,7 @@ export class TextEditor extends EventEmitter {
const data = JSON.parse(code);
const lines = code.split("\n");

markers = Object.values(data.styles as { [key: string]: ResolvedStyleDeclaration[] })
markers = Object.values(data.styles as { [key: string]: Style[] })
// flatten all styles
.reduce((a, b) => [...a, ...b], [])
// find "when" props with errors
Expand Down
Loading

0 comments on commit fbb7517

Please sign in to comment.