ionic-framework

I can't display the openlayer map properly until after a window resize

蓝咒 提交于 2021-01-29 16:00:33
问题 I set up the map like this: this.map = new Map({ target: 'map', layers: [new TileLayer({source: new OSM()}) ], view: new View({ center: [0, 0], zoom: 16, }) }); On opening the page I get this: before resizing So I open the console to make the page smaller and the map is loaded: after resizing Do you have any idea how to fix it? 回答1: A bit more than a year ago I answer a similar question. Take a look at the question Angular 6 - Rendering problems if BrowserAnimationsModule imported (Openlayers

How to properly setup my Ionic (Angular) dev machine with self-signed certificate?

时光怂恿深爱的人放手 提交于 2021-01-29 14:49:32
问题 I'm working on a Ionic-Angular app and faced quite a few issues due to clear text traffic. So I decided to switch to https even while coding but it wasn't so easy. I open this question and propose the answer I found to keep a trace and hopefully save you some time if you would like to do the same. 回答1: Prerequisite You need a hostname for your dev machine. This name will be declared in certificates and https services will be accessed using this hostname (URLs have to be like https://[hostname

What is the proper way to create UI elements dynamically that have their independent state/data in React (ionic/react)

Deadly 提交于 2021-01-29 14:30:25
问题 I'm not a frontend developer but I know JavaScript well enough for this problem. However, I started working with Ionic lately in combination with the React framework. I'm a beginner with Ionic/React and learning it was fun until I faced this issue. The app I'm developing is simple. I'm receiving values in (near) real time over websockets from the server and I want to show them in the UI. For this, I have ItemSliding or SlidingComponents in the UI, where I can swipe right in order to subscribe

__proto__: Array(0) meaning in javascript- ionic firestore

牧云@^-^@ 提交于 2021-01-29 13:43:02
问题 I am creating an application which has a search bar that connects to firebase and retrieves data and puts it in the search results I know thanks to a console.log that the database is connecting to the application as can be seen in the array printed here in the console 2) [{…}, {…}] 0: {category: "u11", location: "glasgow"} 1: {category: "u13", location: "stirling"} length: 2 __proto__: Array(0) However, my search bar is not returning any results. I am guessing the error is down to the proto

Ionic + Capacitor: Motion does not work on device

北战南征 提交于 2021-01-29 11:31:14
问题 I have a simple Ionic page that should tap into the Motion plugin of Capacitor and show the orientation of the compass the device. Works fine in the Chrome dev console but not on the device itself - whether accessing the ionic server og via XCode. Code comes here: import {Component} from '@angular/core'; import {MotionOrientationEventResult, PluginListenerHandle, Capacitor} from '@capacitor/core'; const {Motion} = Capacitor.Plugins; @Component({ selector: 'app-home', templateUrl: 'home.page

How to compile an ionic project using cordova? Error compiling in cordova

廉价感情. 提交于 2021-01-29 10:39:33
问题 I'm compiling the app using cordova for android, but I get the following error, I don't understand it very well Y using the line command cordova build android For build my app 来源: https://stackoverflow.com/questions/64234809/how-to-compile-an-ionic-project-using-cordova-error-compiling-in-cordova

Could not find which method maven() to invoke from this list:

旧街凉风 提交于 2021-01-29 10:36:08
问题 I am currently attempting to emulate (and then build) and Ionic App (w/ Angular) for Android. I feel the need to preface this by saying am not an Android developer, this is the first time I've had to set up the environment so I apologize for any "obvious" mistakes or missed steps. I have been unable to get past this error (appears after running ionic cordova emulate android --debug --consolelogs ): BUILD FAILED Total time: 0.794 secs [11:12:25] lint finished in 1.74 s Error: /path/to/app

Altering the DOM manually in React

孤街醉人 提交于 2021-01-29 10:25:06
问题 I am using Ionic's IonPicker component, which renders, as a sibling to React's div#root , an ion-picker element, which appears to be a full screen overlay, which has two children: an ion-backdrop element, and its sibling, div.picker-wrapper . I am trying to extract just the div.picker-wrapper element so that I can, say, place it relative to other components in my app, and I also want to be able to add elements to it, like a button that is a child of div.picker-wrapper , and that button would

enable CORS using WCF

僤鯓⒐⒋嵵緔 提交于 2021-01-29 10:11:36
问题 I'm trying to enable CORS using WCF. But I get Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 404. This is my Global.asax protected void Application_BeginRequest(object sender, EventArgs e) { HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "*"); if (HttpContext.Current.Request

Not allowed to load local resource: file:///storage/emulated/0/Download/1533311989863.png ionic 3 (android)

▼魔方 西西 提交于 2021-01-29 09:58:04
问题 I got error in ionic 3(android) at load image on from local phone or sd-card storage, path="file:///storage/emulated/0/Download/1533311989863.png" <img [src]="path" > </img> I also tried, path="file://storage/emulated/0/Download/1533311989863.png" OutPut:- Not allowed to load local resource: file:///storage/emulated/0/Download/1533311989863.png 回答1: Read as base64 from filesystem using ionic-native File plugin: File.readAsDataURL(cordova.file.dataDirectory, fileUrl).then(imageBase64 => { self