This app provides the map user interface for browsing data on Open Charge Map (https://map.openchargemap.io). It can also be embedded by other websites using an iframe.
The app is implemented using the Angular version of the Ionic Framework.
The build/runtime configuration settings are in /src/environments/environment.ts
and environment.prod.ts
.
The .prod.ts
version is used when you build with the --prod
flag.
At a minimum the apiBase
setting must be set to a working OCM API host and the mapBoxToken
must be set to a real mapbox API key.
Feature toggles are defined by the enabledFeatures
array, the app will check for the presence of a feature in this array before enabling related UI. This is where additional feature toggles would be defined and this allows dev and prod versions to have different features toggled on.
Install Ionic CLI
npm install -g @ionic/cli
Install npm modules: npm install
(depending on Angular version may require npm install --legacy-peer-deps
or npm install --force
)
To run in desktop browser: ionic serve
Run ionic build --prod
which will output html build to www folder. When updating live app, preserve web.config and favicon.
Copy www
output to gh-pages branch and commit to publish. When updating live app, preserve CNAME and favicon.
Android and iOS, using Capacitor
Build app: ionic build --prod
Sync app content to platform: npx cap sync
iOS and Android versions historically have different bundle ids.
Android:
com.webprofusion.openchargemap
(including capacitor.config.json
), version code in /app/build.gradle.
npx cap add android
.android:usesCleartextTraffic="true"
to AndroidManifest.xml.#8BC43F
.app:build.gradle default config
as per https://stackoverflow.com/a/26865465/1707154.ionic build --prod
, npx cap sync android
, npx cap open android
, Build > Generate Signed Bundle in Android Studio using private keystore. Publish to play console in releases dashboard.iOS:
npx cap add ios
org.openchargemap.app
(including capacitor.config.json
), version code, set Display Name to 'Open Charge' (for length)./ios/App/App/Assets
with resources/ios/Assets
.ionic build --prod
, npx cap sync ios
.typedoc --options typedoc.json --exclude '**/*+(e2e|spec|index).ts' ./src/