Skip to content

Commit

Permalink
Update to Ionic 2 RC 2, misc fixes and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
webprofusion-chrisc committed Nov 5, 2016
1 parent 7cdd2f8 commit afe07f5
Show file tree
Hide file tree
Showing 28 changed files with 1,757 additions and 1,057 deletions.
31 changes: 16 additions & 15 deletions App/Ionic2/ocm-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,27 @@
"run:before": "build"
},
"config": {
"ionic_rollup": "./config/rollup.config.js"


},
"dependencies": {
"@angular/common": "^2.0.0",
"@angular/compiler": "^2.0.0",
"@angular/compiler-cli": "0.6.2",
"@angular/core": "^2.0.0",
"@angular/forms": "^2.0.0",
"@angular/http": "^2.0.0",
"@angular/platform-browser": "^2.0.0",
"@angular/platform-browser-dynamic": "^2.0.0",
"@angular/platform-server": "^2.0.0",
"@ionic/storage": "^1.0.3",
"@angular/common": "2.1.1",
"@angular/compiler": "2.1.1",
"@angular/compiler-cli": "2.1.1",
"@angular/core": "2.1.1",
"@angular/forms": "2.1.1",
"@angular/http": "2.1.1",
"@angular/platform-browser": "2.1.1",
"@angular/platform-browser-dynamic": "2.1.1",
"@angular/platform-server": "2.1.1",
"@ionic/storage": "1.1.6",
"ionic-angular": "2.0.0-rc.2",
"@types/google-maps": "^3.1.28",
"@types/googlemaps": "^3.25.35",
"@types/leaflet": "^1.0.35",
"angular2-jwt": "^0.1.24",
"cordova-plugin-camera": "^2.2.0",
"cordova-plugin-file": "^4.2.0",
"ionic-angular": "^2.0.0-rc.1",
"ionic-native": "^2.2.3",
"ionicons": "^3.0.0",
"linq-es5": "^1.8.39",
Expand All @@ -39,8 +40,8 @@
"zone.js": "0.6.12"
},
"devDependencies": {
"@ionic/app-scripts": "^0.0.36",
"typescript": "^2.0.3"
"@ionic/app-scripts": "^0.0.39",
"typescript": "^2.0.7"
},
"name": "io.openchargemap.app",
"description": "The Open Data registry of EV charging locations",
Expand Down Expand Up @@ -68,4 +69,4 @@
"main": "index.js",
"author": "",
"license": "ISC"
}
}
11 changes: 8 additions & 3 deletions App/Ionic2/ocm-app/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,21 @@ export class MyApp implements OnInit{
//this.translate.useStaticFilesLoader('lang', '.json');
var defaultLang = "it";
var userLang = navigator.language.split('-')[0]; // use navigator lang if available
userLang = /(it|en)/gi.test(userLang) ? userLang : defaultLang;
userLang = /(it|en|sk)/gi.test(userLang) ? userLang : defaultLang;
//userLang="sk";
// optional, default is "en"
this.translate.setDefaultLang(defaultLang);
// the lang to use, if the lang isn't available, it will use the current loader to get them

this.logger.log("[translate] " + navigator.language + ":: using language:" + userLang);
this.translate.use(userLang).subscribe(() => {
var test = this.translate.get("ocm.general.shortDescription");
test.subscribe(data => {
this.logger.log("Testing translation");

this.translate.get('ocm.general.shortDescription', {value: 'world'}).subscribe((res: string) => {
console.log(res);
//=> 'hello world'
});
var test = this.translate.get("ocm.general.shortDescription").subscribe(data => {
this.logger.log("Translation test:" + data);
});
});
Expand Down
12 changes: 7 additions & 5 deletions App/Ionic2/ocm-app/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import { IonicApp, IonicModule, Events } from 'ionic-angular';
import { MyApp } from './app.component';

import { TabsPage } from '../pages/tabs/tabs';
import {TranslateModule } from 'ng2-translate/ng2-translate';
import { TranslateModule } from 'ng2-translate/ng2-translate';
import { TranslateService, TranslateLoader, TranslateStaticLoader } from 'ng2-translate/src/translate.service';

import {NullableTranslatePipe} from '../pipes/NullableTranslatePipe';
import { NullableTranslatePipe } from '../pipes/NullableTranslatePipe';

export function createTranslateLoader(http: Http) {
return new TranslateStaticLoader(http, './assets/i18n', '.json');
}
Expand Down Expand Up @@ -61,13 +62,14 @@ export function createTranslateLoader(http: Http) {
],
imports: [
IonicModule.forRoot(MyApp),

HttpModule,
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: createTranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
})

],
bootstrap: [IonicApp],
entryComponents: [
Expand Down Expand Up @@ -98,6 +100,6 @@ export function createTranslateLoader(http: Http) {
ReferenceDataManager,
GoogleMapsDirections]
})
export class AppModule {
export class AppModule {

}
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file modified App/Ionic2/ocm-app/src/assets/lib/leaflet/images/layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 18 additions & 46 deletions App/Ionic2/ocm-app/src/assets/lib/leaflet/leaflet-providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@
}
},
France: {
url: 'http://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
url: '//{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png',
options: {
maxZoom: 20,
attribution: '© Openstreetmap France | {attribution.OpenStreetMap}'
}
},
HOT: {
url: 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
url: '//{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
options: {
attribution: '{attribution.OpenStreetMap}, Tiles courtesy of <a href="http://hot.openstreetmap.org/" target="_blank">Humanitarian OpenStreetMap Team</a>'
}
Expand All @@ -138,12 +139,12 @@
OpenTopoMap: {
url: '//{s}.tile.opentopomap.org/{z}/{x}/{y}.png',
options: {
maxZoom: 16,
maxZoom: 17,
attribution: 'Map data: {attribution.OpenStreetMap}, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
}
},
Thunderforest: {
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png',
url: '//{s}.tile.thunderforest.com/{variant}/{z}/{x}/{y}.png?apikey={apikey}',
options: {
attribution:
'&copy; <a href="http://www.thunderforest.com/">Thunderforest</a>, {attribution.OpenStreetMap}',
Expand Down Expand Up @@ -198,7 +199,7 @@
}
},
Hydda: {
url: 'http://{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
url: '//{s}.tile.openstreetmap.se/hydda/{variant}/{z}/{x}/{y}.png',
options: {
variant: 'full',
attribution: 'Tiles courtesy of <a href="http://openstreetmap.se/" target="_blank">OpenStreetMap Sweden</a> &mdash; Map data {attribution.OpenStreetMap}'
Expand All @@ -209,39 +210,6 @@
RoadsAndLabels: 'roads_and_labels'
}
},
MapQuestOpen: {
/* Mapquest does support https, but with a different subdomain:
* https://otile{s}-s.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}
* which makes implementing protocol relativity impossible.
*/
url: 'http://otile{s}.mqcdn.com/tiles/1.0.0/{type}/{z}/{x}/{y}.{ext}',
options: {
type: 'map',
ext: 'jpg',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Map data {attribution.OpenStreetMap}',
subdomains: '1234'
},
variants: {
OSM: {},
Aerial: {
options: {
type: 'sat',
attribution:
'Tiles Courtesy of <a href="http://www.mapquest.com/">MapQuest</a> &mdash; ' +
'Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency'
}
},
HybridOverlay: {
options: {
type: 'hyb',
ext: 'png',
opacity: 0.9
}
}
}
},
MapBox: {
url: '//api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}',
options: {
Expand Down Expand Up @@ -281,17 +249,15 @@
Terrain: {
options: {
variant: 'terrain',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
minZoom: 0,
maxZoom: 18
}
},
TerrainBackground: {
options: {
variant: 'terrain-background',
minZoom: 4,
maxZoom: 18,
bounds: [[22, -132], [70, -56]]
minZoom: 0,
maxZoom: 18
}
},
TopOSMRelief: {
Expand Down Expand Up @@ -562,7 +528,7 @@
}
},
BasemapAT: {
url: '//maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
url: 'https://maps{s}.wien.gv.at/basemap/{variant}/normal/google3857/{z}/{y}/{x}.{format}',
options: {
maxZoom: 19,
attribution: 'Datenquelle: <a href="www.basemap.at">basemap.at</a>',
Expand All @@ -572,7 +538,12 @@
variant: 'geolandbasemap'
},
variants: {
basemap: 'geolandbasemap',
basemap: {
options: {
maxZoom: 20, // currently only in Vienna
variant: 'geolandbasemap'
}
},
grau: 'bmapgrau',
overlay: 'bmapoverlay',
highdpi: {
Expand All @@ -583,6 +554,7 @@
},
orthofoto: {
options: {
maxZoom: 20, // currently only in Vienna
variant: 'bmaporthofoto30cm',
format: 'jpeg'
}
Expand Down
Loading

0 comments on commit afe07f5

Please sign in to comment.