Question

I am testing the google maps api by setting up markers on the map. When the map is clicked, it sends an JSON request to a php, save the latitude and longitude in a mysql database and then adds the marker with a javascript function using the google maps api, pretty simple. The problem is that it is working with chrome and firefox, but it is not working from my cellphone with opera mini browser, it is an android 2.3.4.

The navigator that comes with the cellphone has no problems in displaying the markers.

Code: (2 FUNCTIONS)

function agregoCoordenadasEnBaseDeDatos(punto)
{
    //  alert(JSON.encode(punto));
    punto['a']=punto['$a'];
    new Request({'url':'insertarMarcador.php?puntoCorchs=' + JSON.encode(punto), 
                                 'method':'get', 
                                 'onSuccess':function(o){agregarPunto(punto);},
                                 'onFailure':function(o){alert("Pelate!!!  "+o)}}).send();
}
     function agregarPunto(punto)
     {

        var marker = new google.maps.Marker({position: punto, 
                                                        map: first_map, 
                                                    title:'Hola Mundo!!!', 
                                                    icon:'IMAGEFILEURLDELETED.GIF', optimized: false});
    google.maps.event.addListener(marker, 'click', function() {
    first_map.setZoom(8);
    first_map.setCenter(marker.getPosition());    
        });         
}

Is it a known issue?

Do I need to use an if statement regarding which browser is visiting my site?

Was it helpful?

Solution

Opera Mini is a thin client which receives an "intelligent" image (OBML) precompiled on Opera Servers. When you enter an address, the thin client on your phone sends it to Opera servers which does the real HTTP request to the distant server. Then the Opera servers receive the response, create the image and sends it back to the thin client. So per se there is no css, html, js reaching the thin client. Just the OBML image. So when you trigger an action on the client side it is not effective without having to do a round trip through the server. For the specific support of XMLHttpRequest events, see the guidelines of Opera Mini. This is the trade-off in between saving bandwidth (80%) and live interactions on the device. That said Opera is trying to improve it step by step.

Also did you try Opera Mobile 12, different product than Opera Mini?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top