Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (android)
Viewing all articles
Browse latest Browse all 7655

Google Maps showing blank grid (not API key problem, libEGL problem)

$
0
0

I am working on Android app on Windows 7 with Titanium 3.2.3.GA.

I was recently working on showing Google Maps v2. I never had any problem before (yes I obtained API, configured module correctly). The good proof is that it works smoothly on Xperia Z2.

On Samsung S+ I get grey grid but not map. It is quite surprising because in past I was making apps using Google Maps and I was testing on that phone and I never had any problem.

This is my code:

exports.places= function(pWidth, pHeight, window) {
 
    var ifError = 0;
 
    var name = Ti.App.Properties.getString('userFullname');
    var MapModule = require('ti.map');
 
    var places = Ti.UI.createView({
        width: '80%',
        top: '100dp',
        bottom: '100dp',
        backgroundColor: 'red',
        layout: 'vertical'
    });
 
    var helloLabel = Ti.UI.createLabel({
        text: "Hello: " + name,
        color: '#fff',
        font: {fontSize: '18dp', fontWeight: 'bold'}
    });
 
    var pleaseLabel = Ti.UI.createLabel({
        text: "Please choose Your work destination",
        color: '#fff',
        font: {fontSize: '14dp'}
    });
 
    var mapSpace = Ti.UI.createView({
        width: '100%',
        height: '20dp'
    });
 
    Titanium.Geolocation.purpose = "Find nearest places";
    Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
    Titanium.Geolocation.distanceFilter = 100;
 
    var region = {};
 
    Titanium.Geolocation.getCurrentPosition(function(e){
 
            if(e.code != 6) {
               region={
                    latitude: e.coords.latitude,
                    longitude: e.coords.longitude,
                    animate:true,
                    latitudeDelta:0.1,
                    longitudeDelta:0.1
                };
 
             } else {               
                ifError = 1;
             }
        });
 
 
    var placesMap = MapModule.createView({
        userLocation: true,
        mapType: MapModule.NORMAL_TYPE,
        animate: true,
        region: region,
        height: '150dp',       
        width: '100%'
    });
 
 
 
    if(ifError == 0) {
        places.add(helloLabel);
        places.add(pleaseLabel);
        places.add(mapSpace);
        places.add(placesMap);  
 
        return places;  
    } else {
        var errorView = require('libs/error').error(pWidth, pHeight, window, 'noLocation');
        return errorView;
    }
 
};

I found that when I am trying to initialize map Titanium shows me such informations:

[INFO] :   I/Google Maps Android API: Google Play services package version: 5084034
[ERROR] :  libEGL: eglCreateWindowSurface  format=4
Thanks in advance for any help.

Viewing all articles
Browse latest Browse all 7655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>