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

Web and WebWorks Development

Reply
Developer
FloPMT
Posts: 160
Registered: ‎03-12-2011
My Device: PlayBook♥
My Carrier: eplus

BBUI & Viewport Problem

Hi guys,

 

I'm working on a maps app right now using BBUI & web works.

The functionality is great - thanks to video uploaded earlier.

 

The thing is that the map itself is way to "small". Don't get me wrong - it fills the device size.

But there are two problems:

 

1) the meta tag I'm usually using: 

<meta name="viewport" content="width=384, initial-scale=1.0, user-scalable=no">

 

is not working.

 

---> 2) the map's width and height must be 768x1280 to fill the device.

----> the markers, street view etc. are extremely small, not user friendly at all.

 

I guess this is becuase of BBUI because in former projects, not using BBUI, I was always able to use the meta tag and make it more user friendly.

 

Can anybody please help me out?

----------
Please give free Likes if I helped you out! :smileyhappy:
Please use plain text.
Developer
FloPMT
Posts: 160
Registered: ‎03-12-2011
My Device: PlayBook♥
My Carrier: eplus

Re: BBUI & Viewport Problem

[ Edited ]

I just noticed this: https://github.com/blackberry/bbUI.js/issues/295

But it doesn't provide me with a solution...

 

Inside the BBUI.js search for "viewport" and delete commands done there.

 

But I guess everything's even worse now :smileysad:

 

 

It seems BBUI is fixed to the screen size of the Dev Alpha so changing this makes every proportion go crazy. :smileysad:

----------
Please give free Likes if I helped you out! :smileyhappy:
Please use plain text.
Developer
FloPMT
Posts: 160
Registered: ‎03-12-2011
My Device: PlayBook♥
My Carrier: eplus

Re: BBUI & Viewport Problem

[ Edited ]
 
----------
Please give free Likes if I helped you out! :smileyhappy:
Please use plain text.
Developer
FloPMT
Posts: 160
Registered: ‎03-12-2011
My Device: PlayBook♥
My Carrier: eplus

Re: BBUI & Viewport Problem

[ Edited ]
 
----------
Please give free Likes if I helped you out! :smileyhappy:
Please use plain text.
Trusted Contributor
usr501
Posts: 222
Registered: ‎03-03-2012
My Device: Ripple, LE Z10, Dev Alpha _C, Playbook, Bold 9900
My Carrier: rogers

Re: BBUI & Viewport Problem

try this :

 

<style type="text/css">  html { height: 100% }  body { height: 100%; margin: 0; padding: 0 }  #map_canvas { height: 100% }</style>

 This CSS declaration indicates that the map container<div>(named map_canvas) should take up 100% of the height of the HTML body. Note that we must specifically declare those percentages for<body> and <html> as well.

Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: BBUI & Viewport Problem

Wotcha Flo

 

Try this...

 

Skip the width in the meta - that will definitely make this happen

 

If you wanna get everything fitting nicely measure the screen with some easy JS

 

     var wh = window.innerHeight;
     var ww = window.innerWidth;

You can now size and place everything as you wish

 

Mail me if you need the complex explanation




Click the like button if you find my posts useful!
Please use plain text.
Developer
FloPMT
Posts: 160
Registered: ‎03-12-2011
My Device: PlayBook♥
My Carrier: eplus

Re: BBUI & Viewport Problem

Guys thank you very much for your ideas but unfortunately I've tried all of this.
I'll mail you later Simon, thanks!
----------
Please give free Likes if I helped you out! :smileyhappy:
Please use plain text.
Developer
peardox
Posts: 1,229
Registered: ‎03-20-2011
My Device: Playbook, Z10 LE, Dev Alpha B, 2x Dev Alpha C
My Carrier: 3, Orange, Vodafone

Re: BBUI & Viewport Problem

Sure Flo

 

Send me the source and I'll have a play




Click the like button if you find my posts useful!
Please use plain text.
Developer
SumiGhosh
Posts: 435
Registered: ‎09-20-2011
My Device: Z10 LE, Playbook, DevAlpha C, 9900, 9380
My Carrier: Vodafone

Re: BBUI & Viewport Problem

[ Edited ]

Try this as view port meta tag.......        <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>

Please use plain text.