mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 913 forks source link

PluginMap.h is missing the resizeMap definition #2878

Open TylerBreau opened 2 years ago

TylerBreau commented 2 years ago

I'm submitting a ... (check one with "x")

OS: (check one with "x")

cordova information: (run $> cordova plugin list) cordova-plugin-googlemaps 2.7.1 "cordova-plugin-googlemaps"

Current behavior:

The JavaScript API includes 'refreshLayout', which calls on the native API 'resizeMap'.

In iOS native code, there is only 1 reference of 'resizeMap', inside PluginMap.m:

- (void)resizeMap:(CDVInvokedUrlCommand *)command {

Using breakpoints in XCode, I found that the native iOS API 'resizeMap' is not called after the JavaScript API 'refreshLayout' is called. Based on my knowledge of iOS Cordova plugin development, the header file must declare APIs.

I modified the plugin directly in XCode to add the following line to PluginMap.h: - (void)resizeMap:(CDVInvokedUrlCommand*)command;

Testing with my modification, I found that the native API 'resizeMap' was actually being called.

Expected behavior:

When calling the JavaScript API 'refreshLayout', which makes a native call to the API 'resizeMap', I would expect the iOS implementation of 'resizeMap' to be called.