Googlemaps issue

57 views
Skip to first unread message

Greenkohl23

unread,
Mar 4, 2014, 8:13:18 AM3/4/14
to codenameone...@googlegroups.com
Hey,

I have a question regarding Google Maps.
The standard tile size is 256 but practically it's unusable due to copyright notices which are strewn all over the map.






















To workaround this Shai recommended in a different topic to increase the tile size. On the first sight it fixes the problem (tile size = 512):


But if I go into another menu and then go back to the map, it's unusable again. Not only the copyright notices are back, but also the map is chopped (take a closer look at the streets):


The function is implemented like this:

    @Override
   protected void beforeMap(Form map) {
       Util util = new Util();

        map.setLayout(new BorderLayout());
       map.setScrollable(false);

        final MapComponent mc = new MapComponent(new GoogleMapsProvider("my api key"));
       GoogleMapsProvider.setTileSize(512);

        Image i = fetchResourceFile().getImage("current_location.png");
       util.putMeOnMap(mc, i);
       mc.zoomToLayers();

        map.addComponent(BorderLayout.CENTER, mc);
       map.show();
   }

How can I fix this problem?

kevin....@gmail.com

unread,
Mar 4, 2014, 10:05:56 AM3/4/14
to codenameone...@googlegroups.com
I do see the behavior you're describing in the simulator.  I'm curious to know if you also see it on your phone.  I had been wondering how to get rid of those copyright notices, and I see that it does work as you say in the simulator.
Message has been deleted

Shai Almog

unread,
Mar 4, 2014, 2:34:49 PM3/4/14
to codenameone...@googlegroups.com, kevin....@gmail.com
Hi,
this is a problematic issue. Google started putting these notices a while ago and I'm not sure if there is a way to disable them. As far as our research went there seems to be no way to do this other than using Open Street map data.

Diamond

unread,
Oct 3, 2014, 4:10:09 PM10/3/14
to codenameone...@googlegroups.com



I fixed this by using this simple hack:

        GoogleMapsProvider.setTileSize(256);
        final MapComponent map = new MapComponent(new GoogleMapsProvider("API_KEY"));
        GoogleMapsProvider.setTileSize(512); 
 
Reply all
Reply to author
Forward
0 new messages