Skip to content

Commit

Permalink
Migrate to mapbox #997 - added limited support to arcgis, added rtl, …
Browse files Browse the repository at this point in the history
…fixed expression changed after check error
  • Loading branch information
HarelM committed Apr 22, 2019
1 parent 1dc76ba commit 6848e49
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
9 changes: 7 additions & 2 deletions IsraelHiking.Web/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
"sources/resource-not-found.html",
"sources/empty-for-oauth.html",
"sources/robots.txt",
"sources/cordova.js"
"sources/cordova.js",
{
"glob": "**/mapbox-gl-rtl-text.js",
"input": "./node_modules/@mapbox/mapbox-gl-rtl-text",
"output": "./"
}
],
"styles": [
"sources/scss/common.scss"
],
"scripts": [
"sources/google-analytics.js",
"sources/google-analytics.js"
]
},
"configurations": {
Expand Down
2 changes: 2 additions & 0 deletions IsraelHiking.Web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@angular/platform-server": "7.1.1",
"@angular/router": "7.1.1",
"@beyerleinf/ngx-dnd": "6.0.0-preview3",
"@mapbox/mapbox-gl-rtl-text": "0.2.1",
"@ngx-progressbar/core": "5.3.1",
"@ngx-progressbar/http": "5.3.1",
"@nicky-lenaers/ngx-scroll-to": "1.1.1",
Expand Down Expand Up @@ -110,6 +111,7 @@
"build": "ng build",
"build:watch": "ng build --watch",
"build:prod": "ng build --prod",
"build:prod-beta": "ng build --prod --base-href=/beta/",
"test": "ng test",
"lint": "ng lint --fix",
"version": "node -v && npm -v && ng -v",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,19 @@ export class AutomaticLayerPresentationComponent implements OnInit, OnChanges, O
}

private isRaster(address: string) {
return !address.endsWith("json") && !address.endsWith("/mapserver");
return !address.endsWith("json");
}

private createRasterLayer() {
let address = this.address;
if (this.address.toLocaleLowerCase().endsWith("/mapserver")) {
//address += "/tile/{z}/{y}/{x}"
address += "/export?dpi=96&transparent=true&format=png32&bbox={bbox-epsg-3857}&bboxSR=3857&imageSR=3857&size=256,256&f=image";
}
console.log("adrs:", address);
let source = {
type: "raster",
tiles: [this.address],
tiles: [address],
minzoom: this.minZoom,
maxzoom: this.maxZoom,
tileSize: 256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class LayersViewComponent extends BaseMapComponent implements OnInit, Aft
this.categoriesTypes = this.poiService.getCategoriesTypes();
this.selectedCluster = null;
this.hoverFeature = null;
this.selectedPoiFeature = null;
this.selectedPoiGeoJson = {
type: "FeatureCollection",
features: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, ViewChild, AfterViewInit, ViewEncapsulation, ViewChildren, Q
import { NgxImageGalleryComponent } from "ngx-image-gallery";
import { NgRedux } from "@angular-redux/store";
import { MapComponent, CustomControl } from "ngx-mapbox-gl";
import { Style } from "mapbox-gl";
import { Style, setRTLTextPlugin } from "mapbox-gl";

import { ResourcesService } from "../../services/resources.service";
import { BaseMapComponent } from "../base-map.component";
Expand Down Expand Up @@ -120,6 +120,8 @@ export class MainMapComponent extends BaseMapComponent implements AfterViewInit
this.imageGalleryService.setGalleryComponent(this.ngxImageGallery);
}
public mapLoaded() {
setRTLTextPlugin("/mapbox-gl-rtl-text.js", () => {});

this.mapService.setMap(this.mapComponent.mapInstance);
this.snappingService.setMap(this.mapComponent.mapInstance);

Expand Down

0 comments on commit 6848e49

Please sign in to comment.