mapsplugin / cordova-plugin-googlemaps

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

Error when try to run an ionic project #913

Closed diegognt closed 8 years ago

diegognt commented 8 years ago

at run ionic run ios I got:

/projectPath/platforms/ios/project/Plugins/plugin.google.maps/MyPluginLayer.m:43:32: error: property 'scrollView' not found on object of type 'UIView *'
  float offsetX = self.webView.scrollView.contentOffset.x;// + self.mapCtrl.view.frame.origin.x;
                               ^
/projectPath/platforms/ios/project/Plugins/plugin.google.maps/MyPluginLayer.m:44:32: error: property 'scrollView' not found on object of type 'UIView *'
  float offsetY = self.webView.scrollView.contentOffset.y;// + self.mapCtrl.view.frame.origin.y;
                               ^
/projectPath/platforms/ios/project/Plugins/plugin.google.maps/MyPluginLayer.m:106:32: error: property 'scrollView' not found on object of type 'UIView *'
  float offsetX = self.webView.scrollView.contentOffset.x;// + self.mapCtrl.view.frame.origin.x;
                               ^
/projectPath/platforms/ios/project/Plugins/plugin.google.maps/MyPluginLayer.m:107:32: error: property 'scrollView' not found on object of type 'UIView *'
  float offsetY = self.webView.scrollView.contentOffset.y;// + self.mapCtrl.view.frame.origin.y;
                               ^
/projectPath/platforms/ios/project/Plugins/plugin.google.maps/MyPluginLayer.m:131:39: error: property 'scrollView' not found on object of type 'UIView *'
  rectangle.size.width = self.webView.scrollView.contentSize.width;
                                      ^
/projectPath/Plugins/plugin.google.maps/MyPluginLayer.m:137:39: error: property 'scrollView' not found on object of type 'UIView *'
  rectangle.size.width = self.webView.scrollView.contentSize.width;
                                      ^
/projectPath/platforms/ios/project/Plugins/plugin.google.maps/MyPluginLayer.m:138:40: error: property 'scrollView' not found on object of type 'UIView *'
  rectangle.size.height = self.webView.scrollView.contentSize.height;
diegognt commented 8 years ago

@wf9a5m75

wf9a5m75 commented 8 years ago

Thank you for refiling as another issue. Could you share your whole project (not only www directory, but also platforms, config.xml, hooks, plugins directories also) using git repository (such as github or bitbucket)?

diegognt commented 8 years ago

I start to use cordova-ios 4.x and works

wf9a5m75 commented 8 years ago

Yes, the next version (actually the master branch code) supports WKWebView.

castrojr913 commented 8 years ago

I'm engaging a russian roulette: the plugin works with WKWebview using cordova plugin add cordova-plugin-wkwebview-engine, but it forces my ionic app remains with white background all the views except the Splash screen. If I rule the early plugin out, It works the project but the GMap plugin doesn't work. If I install another plugin cordova plugin add cordova-plugin-wkwebview instead, It requires a 3.x versions of Cordova and It provokes the exception how @diegognt describes.

xloading commented 8 years ago

@castrojr913 did you resolve this dependency circle? It seems I'm facing the same.

alepht commented 8 years ago

I am having similar issue of that using Monaca Online for IOS, thanks in advance for your help

castrojr913 commented 8 years ago

@xloading Yes, fortunately. Use this WKWebview plugin and upgrade cordova ios version to 4.x.x. I used 4.0.1 version in my case. Likewise, use the master version of GMap plugin. Another thing: set absolute values for width and height properties of <div> tag which you will use for GMap. I tried with relative values and the map was not rendered. In order to fix the trouble with different iPhone ratios, you can use CSS media queries.

alepht commented 8 years ago

I am using Monaca and upgrade to the cordova ios version to 4.x.x is not an option, do we have other posible solution for this issue?

Thanks very much

xloading commented 8 years ago

@castrojr913 thanks a lot! It looks that in my case the problem was indeed related to div properties.

alepht commented 8 years ago

I am pushing the Monaca guys in order to them upgrade to Cordova 6, let's see what happens ... hopefully I found a solution in the next 45 days before the release of the app