Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228598 articles
Browse latest View live

Mapbox doesn't display full until I put full screen or open developer tools

$
0
0

I am using a mapbox api to generate a map. I’m trying to make width and height equal to 100%, but the class mapboxgl-canvas has a default value when start it’s 300px for witdth and 400px for height.

But when I give full screen or developer tools it is placed with the css styles that I defined which are these

#map {

    width: 100%;

    height: 100%;

  }

This is my tab2.page

<ion-header>

  <ion-toolbar>

    <ion-title>

      Tab 2

    </ion-title>

  </ion-toolbar>

</ion-header>

<ion-content>

  <div id="map"></div>

 </ion-content>

And my TypeScript file


import { Component, OnInit } from '@angular/core';

import { environment } from '../../environments/environment.prod';

import * as Mapboxgl from 'mapbox-gl';

@Component({

  selector: 'app-tab2',

  templateUrl: 'tab2.page.html',

  styleUrls: ['tab2.page.scss']

})

export class Tab2Page implements OnInit{

  constructor() {}

  title = 'view';

  map: Mapboxgl.Map;

  ngOnInit(){

    (Mapboxgl as any).accessToken = environment.mapboxKey;

    this.map = new Mapboxgl.Map({

    container: 'map', // container id

    style: 'mapbox://styles/mapbox/outdoors-v11',

    center: [-74.810913,10.985246], // LNG, LAT

    zoom: 14 // starting zoom

    });

     

    // Add zoom and rotation controls to the map.

    this.map.addControl(new Mapboxgl.NavigationControl());



  }

}

Ionic V5 Navigate back with parameters

$
0
0

The problem with this design (OK, my problem with this design) is that it makes page B too dependent on page A. What I would do instead is to make a service whose job it is to carry whatever “the selected thing” is. Those who change it change it, those who care about watching it change watch it change.

Installation instructions for plugins gone after Ionic 5

$
0
0

You’re right. For whatever reason, there is a

display: none!important;

attribute.

Ionic V5 Navigate back with parameters

$
0
0

I just don’t understand why global state is needed for a problem like this. I think it couples the page B too close to a specific problem.

I want to reuse B at a latter point in another page C, which could try to select an item from the same list for different reasons.

Ionic V5 Navigate back with parameters

$
0
0

OK, then I guess we’re at a standoff on that point.

Then what about embedding B instead of having it be a standalone page? If I’m a user, I expect page B to act the same way every time I deal with it. I would be surprised if things went differently depending on whether I came at it from A or C. However, if it was a component embedded in page A and C, I wouldn’t have that problem.

And you wouldn’t have the problem you’re having either, because you could declare an @Output() binding in component B and bind it from page A or C to do whatever you desire.

Ionic 4 angular downloaded file using http get not exist

$
0
0

question updated. the subscribe part code added

Ionic 4 angular downloaded file using http get not exist

$
0
0

I think the problem is that your map operator is throwing the actual download results in the trash can.

Your initial request is asking for an ArrayBuffer, and that should be what is coming in the body property of the final HttpEventResponse. However, you’re mapping that event to pay attention only to the event type, and returning just the string Done, so by the time we get past that map the original event with its precious cargo has been tossed aside.

Upload photo to firebase storage

$
0
0

Hello Team,

can someone help me. I’m trying to upload images gallery to firabse storage.
but it does not work.

here is my code : let me know if something is wrong.

store() {

this.fc.open().then((url) => {

  this.fp.resolveNativePath(url).then(resolvenativepath => {

    this.returnpath = resolvenativepath;

    this.uploadimage();

  });

  });

}

uploadimage() {

(<any>window).resolveLocalFileSystemURL(this.returnpath, (newurl) => {

  newurl.file((resFile) => {

    const reader = new FileReader();

    reader.readAsArrayBuffer(resFile);

    reader.onloadend = (evt: any) => {

      const imgBlob = new Blob([evt.target.result], {type: 'image/jpeg'});

      const imagestore = this.firestore.ref().child('image');

      // tslint:disable-next-line:no-shadowed-variable

      imagestore.put(imgBlob).then((newurl) => {

        alert('upload ok ...');

      }).catch((err) => {

        alert('upload nok' + err);

      });

    };

  });

});

}Preformatted text


Binding

$
0
0

I got a “Kompetenzbereich” in my “note”-Object and i want the ion-select to automatically select the right “Kompetenzbereich”.

  <ion-item>
    <ion-label position="stacked">Kompetenzbereich</ion-label>
    <ion-select 
      multiple="false" 
      cancelText="Cancel" 
      okText="Ok"
      [(ngModel)]="note.lntKompId"
    >
      <ion-select-option *ngFor="let komp of kompetenzbereiche" [value]="komp">
        {{ komp.komBezeichnung }}
      </ion-select-option>
    </ion-select>
  </ion-item>

Upload photo to firebase storage

$
0
0

All of those nested Promises make my head spin, and I think you should look at this.

Binding

$
0
0

Can you show us the part where you assign to note.lntKompId?

Binding

$
0
0
  ngDoCheck() {
    this.note = this.exchange.note;
  }

The problem just appears with the <ion-select>, with for example for a string or a date, it works fine.

  <ion-item>
    <ion-label 
    position="stacked">Testdatum</ion-label>
    <ion-datetime 
      displayFormat="DD/MM/YYYY" 
      min="2015-09-01"
      [(ngModel)]="note.lntTimestamp"
      >
    </ion-datetime>
  </ion-item>

Binding

$
0
0

I asked for where you assign to note.lntKompId, not note. As you seem to be on the road to discovering out, the problem likely lies with JavaScript’s crappy fake OO “support” and the difficulty of comparing objects for equality. I can’t say much further without seeing a MCVE.

Upload photo to firebase storage

$
0
0

okay…

Can you help on the question ?

Binding

$
0
0

this is a property of note i get from the backend. i don’t assign it explicit.

i implemented a compareWith for my ion-select, now if i click on the select, the value is selected, but not displayed from the beginning


Ionic V5 Navigate back with parameters

$
0
0

I might be trying to use navigation for something it isn’t intended for, since I never want B to be used directly without being started from another activity like A or C.

The reason I didn’t use a component directly is because I wanted to open a new activity so I had enough space to display the entire list.

A modal might be a better fit for this kind of flow, since it allows taking the entire screen. Sorry I am new, so I don’t know all the options available yet, and I got confused since the v3 navigation system allowed it and I thought I was just missing the correct parameters :slight_smile:

Ionic V5 Navigate back with parameters

$
0
0

Yes, that sounds like a much better fit to me as well.

We’ll have to do the whole “agree to disagree” bit about whether that was a good thing. Personally, I found the whole NavParams concept brittle and conducive to designs that I ended up having a hard time sustaining. I don’t miss it one bit.

CSS Hypenation for Ionic project

$
0
0

I have a set of paragraphs on one of my pages in Ionic.
The block of text is justified in CSS.
I want to assign hyphenation to these, but whatever I try it’s not working.

Tutorial I also used for reference:
Link to CSS Hyphenation tutorial

I also tried changin html lang to en in index.html, without any results.
How can I hyphenate a text in Ionic?

2 Side-Menus. Left-menu opens when clicking link from Right-menu

$
0
0

(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)

Installation instructions for plugins gone after Ionic 5

Viewing all 228598 articles
Browse latest View live