Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10
My Carrier: alfa Lebanon
Accepted Solution

Google Maps in a WebView

I'm using Google Maps in a webview to get my users to select a point on the map so I can save its coordinates. (I can't use BlackBerry Maps because well there aren't any for my country - Lebanon - so it doesn't make sense to develop something I can't use)

 

Anyways, it works ok except for putting a marker on the map. I used a basic code to put a marker on mouse click on the map. The marker bllinks for 1 seconds or less and then disappears. Any idea why that is?

Wadi
Developer
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A
My Carrier: Sprint

Re: Google Maps in a WebView

You can answer this better than any of us, simply by enabling the Web Inspector for that WebView and then connecting to your device's inspector port.

http://developer.blackberry.com/cascades/reference/bb__cascades__websettings.html#property-webinspec...

Also, do be sure to keep in mind the security considerations of a WebView.

http://developer.blackberry.com/cascades/documentation/dev/security/index.html#wba1358262288411


Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! Smiley Very Happy
Contributor
Posts: 32
Registered: ‎01-18-2011
My Device: Curve 8900

Re: Google Maps in a WebView

[ Edited ]

Did you get it fixed?

 

I tried, everything that lewellyn recommended, but I didn't know what exactly happens on markers.

 

Everytime that any marker shows (when it shows), its a big image in wrong place (normally under to the right the point that I want to show).

 

I'll try find another way to fix it. but I can't see another way . . . .

 

It might be a problem inside the js, that do not fix the resizing of marker layer ... if you set the marker with draggable : true, it shows the Pin correctly ...

Developer
Posts: 19
Registered: ‎03-28-2013
My Device: www
My Carrier: www

Re: Google Maps in a WebView

I also have the problem  about  if you set the marker with draggable : true, it shows the Pin correctly ...

There is anyone know how to slove the problem? please tell me。

Developer
Posts: 165
Registered: ‎10-04-2010
My Device: P'9982 & Z10
My Carrier: alfa Lebanon

Re: Google Maps in a WebView

Fixing the viewport helped in my case.

 

Add this script in your index.html if you're using BBUI:

        <script>
            var meta = document.createElement("meta");
            meta.setAttribute('name','viewport');
            meta.setAttribute('content','initial-scale='+ (1/window.devicePixelRatio) + ',user-scalable=no');
            document.getElementsByTagName('head')[0].appendChild(meta);
        </script>

 

Wadi
Developer
Posts: 19
Registered: ‎03-28-2013
My Device: www
My Carrier: www

Re: Google Maps in a WebView

I try it, but no effect. Do you have some another ideas.