Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary scrollbar on map #413

Closed
MCKmecik opened this issue Feb 23, 2015 · 15 comments
Closed

Temporary scrollbar on map #413

MCKmecik opened this issue Feb 23, 2015 · 15 comments

Comments

@MCKmecik
Copy link

When I start app and create map, i can see scrollbar on the top right corner on the map (as you can see on the picture). This scrollbar is shown for a while and then it disapears.
Am I doing something wrong?

screenshot_2015-02-23-22-32-29

@hirbod
Copy link
Contributor

hirbod commented Feb 23, 2015

Did you install the #test branch or the official master?

@MCKmecik
Copy link
Author

I installed my app where I use this plugin. Everything works great except this weird behaviour. Is it possible that this may be caused by colliding with different plugin? Because I use more phonegap plugins in my app.

@hirbod
Copy link
Contributor

hirbod commented Feb 23, 2015

This is not the answer of my question. Did you use the official way or did you use the #test branch?

Please post your Plugin List. Type

cordova plugin list

and copy your output here. I guess another plugins view is interfering here.

@MCKmecik
Copy link
Author

What do you mean official way or test branch? I don't understand.

My Plugin List:
android.support.v4 21.0.1 "Android Support v4"
com.google.playservices 21.0.0 "Google Play Service
com.phonegap.plugins.PushPlugin 2.4.0 "PushPlugin"
org.apache.cordova.contacts 0.2.15 "Contacts"
org.apache.cordova.device 0.2.13 "Device"
org.apache.cordova.file 1.3.2 "File"
org.apache.cordova.file-transfer 0.4.8 "File Transf
org.apache.cordova.geolocation 0.3.11 "Geolocation"
org.apache.cordova.inappbrowser 0.5.4 "InAppBrowser
org.apache.cordova.plugin.sms 0.1.0 "Sms"
org.wbt11a.nativecamera 0.1.4 "Native Camera"
plugin.google.maps 1.2.4 "phonegap-googlemaps-plugi
plugin.http.request 1.0.0 "phonegap-http-request"

@wf9a5m75
Copy link
Member

@hirbod I think @MCKmecik is not familiar with git, because @MCKmecik 's github activity is empty.

@MCKmecik I think this issue is fixed in the test version (next coming version).
In order to use it, you need to install git command.
If you use Mac, it is already installed.
If you use Windows, install this
http://git-scm.com/download/win

Then follow the below commands:

$> cordova plugin rm plugin.google.maps  //remove the version 1.2.4
$> cordova plugin add https://github.com/wf9a5m75/phonegap-googlemaps-plugin#test --variable API_KEY_FOR_ANDROID=...
$> cordova run android

@hirbod
Copy link
Contributor

hirbod commented Feb 23, 2015

@wf9a5m75 but his screenshot shows an android device, I thought your view update in #test is only iOS related?

@wf9a5m75
Copy link
Member

Oops, you are right.

Ok, could you show me your HTML code, @MCKmecik ?
You can ignore about the test branch.

@MCKmecik
Copy link
Author

Here is my HTML code. I am using jquery mobile and backbonejs.
Div with id="map" is where I put the google map.

<div data-role="content" role="main" class="ui-content no-padding-top no-padding-right no-padding-bottom no-padding-left">
    <div class="map-view">
        <div id="map">              

        </div>
    </div>
</div>

@wf9a5m75
Copy link
Member

Thanks, and what values do you specify for the html elements?

I think some HTML elements' height over the body.

Do you use Android 4.4 or over?
If so, you can debug with Chrome inspector.
https://developer.chrome.com/devtools/docs/remote-debugging

If you share your code with me, I'll check it.

@MCKmecik
Copy link
Author

Yes I have android 4.4.2.
This behaviour is on my phone (LG optimus l9 II) when I try it on HTC Desire 500, everything is OK.

Thank you for your link, I will check it and send you some result.

@MCKmecik
Copy link
Author

I have checked it, but everything looks ok. Nothing goes over the body.
I will try to uninstall all other plugins and check it again if some other plugin collide with google maps plugin.

@wf9a5m75
Copy link
Member

Could you share your apk file with me?
I will keep yout secret.
Please send it to me: [email protected]

@wf9a5m75
Copy link
Member

Thank you for sending your apk. I checked it.
I reproduced this issue, and try to get rid of this.

test code

<!DOCTYPE html>
<html>
  <head>
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height" />
    <meta charset="utf-8" />
    <title>Google Maps Plugin for Cordova</title>
    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript">
    document.addEventListener('deviceready', function() {
      var div = document.getElementById("map_canvas");
      var map = plugin.google.maps.Map.getMap(div);
    });
    </script>
    <style type="text/css">
      html, body, #map_canvas {
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="map_canvas" ></div>
  </body>
</html>

issue_413

wf9a5m75 added a commit that referenced this issue Feb 24, 2015
@wf9a5m75
Copy link
Member

This issue is fixed.
In order to apply this patch, open platforms/android/src/plugin/google/maps/MyPluginLayout.java with your text editor,
then add the below lines:

Line 73

scrollView.setHorizontalScrollBarEnabled(false);
scrollView.setVerticalScrollBarEnabled(false);

After line 193 and before line 194

scrollView.setHorizontalScrollBarEnabled(false);
scrollView.setVerticalScrollBarEnabled(false);

After line 218 and before line 219

scrollView.setHorizontalScrollBarEnabled(true);
scrollView.setVerticalScrollBarEnabled(true);

See: fa24e53

issue_413

@wf9a5m75 wf9a5m75 added the bug label Feb 24, 2015
@wf9a5m75 wf9a5m75 added this to the v1.2.5 milestone Feb 24, 2015
@MCKmecik
Copy link
Author

Thanks a lot!

wf9a5m75 added a commit that referenced this issue Mar 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants