Use ImageMapResizer with ionic


#1

Hi
I would like to use in my application this plugin


I’ve installed it with npm but I don’t know how to include in my app and use it.
I’ve imported it in the page where I want use this with

import { imageMapResize } from 'image-map-resizer';

then add into the constructor
public imageMapResizer: imageMapResize,

and

  ionViewDidLoad() {
    console.log('ionViewDidLoad ProfilePage');
    $('map').imageMapResize();
  }

but it gives me an error about imageMapResize telling me that it’s not found.

I don’t understand how to use this plugin into a ionic project, can you help me?
Thank you


#2

First at all, import the package as follows:

import imageMapResize from 'image-map-resizer';

Then remove the following declaration from the constructor. It is wrong.

public imageMapResizer: imageMapResize

Finally call the following statement in ionViewDidLoad():

ionViewDidLoad() {
  imageMapResize();
}