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
New Contributor
vincentl1
Posts: 8
Registered: ‎01-03-2013
My Device: dev alpha

Re: Google Map Marker corruption

[ Edited ]

 

i ran in the same problem a couple of day ago.

it seems that  google try to optimize the map draw / redraw  and that it's not working (at least on bb browser , i have'nt tried on another platform ) when the pin is  between 2 map tiles.

 i have not a complete explanation.

 

Please use plain text.
New Contributor
vincentl1
Posts: 8
Registered: ‎01-03-2013
My Device: dev alpha

Re: Google Map Marker corruption

[ Edited ]

hey Chad, i m the Vince who have problem with streetView,, any clue ? it's my last problem before submiting the app :smileyhappy:

I m fighting with google maps for a week :smileyhappy:)

Please use plain text.
New Contributor
vincentl1
Posts: 8
Registered: ‎01-03-2013
My Device: dev alpha

Re: Google Map Marker corruption

pfazzino, concerning the marker size how do you create your icon ?

are you setting the size parameter (not the scaledsize) ? The size parameter should be real size of your png. I got also problems with that
Please use plain text.
Contributor
pfazzino
Posts: 12
Registered: ‎01-16-2013
My Device: BB10 Dev Alpha

Re: Google Map Marker corruption

For testing, I'm just creating the marker using default options without specifying an icon/markerimage and comparing to other platforms so the icon you're seeing in the shots is the default render.

Please use plain text.
New Contributor
vincentl1
Posts: 8
Registered: ‎01-03-2013
My Device: dev alpha

Re: Google Map Marker corruption

as a workaround I used my own icon to control the size... but it's far from perfect.

Please use plain text.
Contributor
pfazzino
Posts: 12
Registered: ‎01-16-2013
My Device: BB10 Dev Alpha

Re: Google Map Marker corruption

so I'm pretty convinced this is a marker scale issue. Either the BB OS is ignoring the png ppm value and not scaling it correctly or gmaps is misbehaving and doesn't know what to do with the BB user agent and is screwing with the marker placement/size.

 

Anyway, I'm managed to work around the issue and now have my custom marker rendering correctly (size and position). You still need to disable marker optimization but the key change I made is to scale up by png's manually in the markerimage constructor. My markers are all 32x37 so given the dev alphas pixel ratio of around 2.2 I'm creating my marker images using

 

var myicon = new google.maps.MarkerImage("myicon.png", null, null, null, new google.maps.Size(70, 80));

 

This renders pretty well

 

map.png

 

Please use plain text.
New Contributor
vincentl1
Posts: 8
Registered: ‎01-03-2013
My Device: dev alpha

Re: Google Map Marker corruption

I switched to leaflet which can manage high density screen. you can specify another icon for high resolution (retinaIcon)

Please use plain text.
BlackBerry Development Advisor
chadtatro
Posts: 620
Registered: ‎10-01-2009
My Device: Z10

Re: Google Map Marker corruption

I had been doing some tests, and asking around to office.  Nothing's changed on our end that should be affecting this (was the general consensus).

 

In my map samples I just pull everything from Google's server.  My recommendation for now is to use Bing, or another service.  No answer as to why the pins are suddenly not scaling.

Chad Tetreault | App Development Consultant | BlackBerry Developer Relations | developer.blackberry.com | @chadtatro
Please use plain text.
Contributor
pfazzino
Posts: 12
Registered: ‎01-16-2013
My Device: BB10 Dev Alpha

Re: Google Map Marker corruption

Hi Chad

 

If you check the Bing rendering you'll see this suffers the same issue with tiny default markers. A few months ago a change was made to bbui to have it automatically detect and apply the correct viewport settings.

 

https://github.com/blackberry/bbUI.js/commit/b9e922a8440c159b93f46a9b7bd2e8a45449ae97

 

Here's some comparison shots of different devices. These are all based on your maps sample app 'tweaked so that I could get it to render on other devices". Both iOS and Android shots are done with 

 

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

 

iOS (iphone 4S)

:iOS.png

 

Android (Nexus 4)

Android.jpg

 

BB10 with default settings (i.e.bbui setting viewport to initial-scale=0.4938271372370243)

Simulator with controls bbui.png

 

BB10 with <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

Simulator with controls.png

 

For user supplied graphics such as the bbui controls, reducing the scale gets around the device dpi issues associated with rescaling of images. Tthe different map providers don't take this into account though therefore tiles/zoom controls/markers/etc... effectively get scaled down by 2+x as a result of this bbui change.

 

Thoughts?

 

 

Please use plain text.