Problem with IOS map

14 views
Skip to first unread message

lmar...@xirectss.com

unread,
Feb 19, 2014, 9:47:43 AM2/19/14
to codenameone...@googlegroups.com
hi,
I used the mapcomponent. In android is displayed properly but in IOS the map does not appear, only shows the icon I've added.

I used the following code:

MapComponent mp = new MapComponent(new CustomGoogleMapsProvider("AIzaSyDNeVsTdLtDoBe9Tpvl5bKgWWjeTfSs-MQ"));
                        Coord cor = new Coord(Double.parseDouble(lat), Double.parseDouble(lon));
                        Image i = fetchResourceFile().getImage("icon_myEnrollments.png");
                        PointsLayer pl = new PointsLayer();
                        pl.setPointIcon(i);
                        PointLayer p = new PointLayer(cor, "You", i);
                        p.setDisplayName(true);
                        pl.addPoint(p);
                        mp.addLayer(pl);
                        mp.zoomToLayers();
                        mp.setZoomLevel(14);

                        findContainerMap(containerMap).addComponent(BorderLayout.CENTER, mp);

Chen Fishbein

unread,
Feb 19, 2014, 11:41:27 AM2/19/14
to codenameone...@googlegroups.com, lmar...@xirectss.com
Google have recently changed some configuration, make sure the Static Maps is enabled on your google project in the google console https://cloud.google.com/console/project

lmar...@xirectss.com

unread,
Feb 19, 2014, 12:45:26 PM2/19/14
to codenameone...@googlegroups.com
I create a custom GoogleMapsProvider called CustomGoogleMapsProvider.
I've only changed the constructor, from this:

 public GoogleMapsProvider(String apiKey) {
        super("http://maps.googleapis.com/maps/api/staticmap?", new Mercator(), new Dimension(tileSize, tileSize));
        this.apiKey = apiKey;
    }

to this:

public CustomGoogleMapsProvider(String apiKey) {
        this.apiKey = apiKey;
    }

I tried the GoogleMapsProvider  by default and works correctly on IOS and Android.with my custom class is shown only in android like in the attached images.
IMG_0296.PNG
Screenshot_2014-02-19-12-36-11.png
Reply all
Reply to author
Forward
0 new messages