Touch event doesn't alert latitude

161 Views Asked by At

I'm trying to use WebGL Earth 2.0 in one of my new projects. The library

can be found here: https://github.com/webglearth/webglearth2

- Let say I want to click on the globe and the browser must alert me back the latitude of the place that I have clicked. What I did was this:

earth.on('click', fire);

var fire = function(e) {

alert('You clicked at ' +e.latitude);
};

It worked on the web browser and returned the latitude, but it did not work on the mobile( iPhone ) browser.

so what I did next was this instead:

 earth.on('touchstart', fire);

 var fire = function(e) {

    alert('You clicked at ' +e.latitude);
    };

It works on the mobile browser (iPhone), but the problem is it doesn't return latitude. Instead it alerts me with "NULL". I want it to return the latitude when I touch the globe in the mobile browser.

Please help me to make it work like I want...

1

There are 1 best solutions below

2
On

I stumbled upon this while testing/researching WebGL Earth. It seems as if they fixed it over the last year using the lat/lng - values should work.