themacvictror's Recent Forum Activity

  • Tom

    Ashley

    TheMac

  • bump ! I'm still stuck !

    I ask for help, i trusted scirra and have paid for full version.

    But support si quite lacking for my needings.

    What's wrong with me ?

    TheMac

  • bump

  • BUMP !

    Ashley

    Is this request so impossible to fulfill ???

    Don't understand.

    Thanks.

    TheMac

  • I had another idea.

    Using the object browser.executeJS can i execute "LINE BY LINE" the following instructions ?

    // Note: This example requires that you consent to location sharing when

    // prompted by your browser. If you see a blank space instead of the map, this

    // is probably because you have denied permission for location sharing.

    var map;

    function initialize() {

    var mapOptions = {

        zoom: 6

    };

    map = new google.maps.Map(document.getElementById('map-canvas'),

          mapOptions);

    // Try HTML5 geolocation

    if(navigator.geolocation) {

        navigator.geolocation.getCurrentPosition(function(position) {

          var pos = new google.maps.LatLng(position.coords.latitude,

                                           position.coords.longitude);

          var infowindow = new google.maps.InfoWindow({

            map: map,

            position: pos,

            content: 'Location found using HTML5.'

          });

          map.setCenter(pos);

        }, function() {

          handleNoGeolocation(true);

        });

    } else {

        // Browser doesn't support Geolocation

        handleNoGeolocation(false);

    }

    }

    function handleNoGeolocation(errorFlag) {

    if (errorFlag) {

        var content = 'Error: The Geolocation service failed.';

    } else {

        var content = 'Error: Your browser doesn\'t support geolocation.';

    }

    var options = {

        map: map,

        position: new google.maps.LatLng(60, 105),

        content: content

    };

    var infowindow = new google.maps.InfoWindow(options);

    map.setCenter(options.position);

    }

    google.maps.event.addDomListener(window, 'load', initialize);

    And then, how can i translate the html declarations :

    1) <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=true"></script>

    and

    2) <body>

        <div id="map-canvas"></div>

    </body>

    ?

    Thanks, hope i'm clear :)

  • Bump , can't use litetween :( !

    TheMac

  • Bump !

    TheMac

  • GameThirsty, thanks for answer.

    But maybe i wasn't clear.

    I don't need to open a simple url in simple new page.

    I know well how to code javascript :-)

    What i really need is this :

    developers.google.com/maps/documentation/javascript/examples/map-simple

    (please look at javascript+html tab, it's clerarer)

    incapsulated in my C2 App.

    Thanks :)

    TheMac

  • GameThirsty

    UP ?

    TheMac

  • GameThirsty

    what's wrong with my code? :(

    vvv(dot)dropbox(dot)com/s/t47halr821hz0ij/testmap.capx

    i have errore "google" is not defined. Isn't it html5 standard ?

    Thanks.

    TheMac

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • LittleStain,

    i found this :

    (scirraDOTcom)/726/swipe-to-change-page

    to be more or leass what i needed, but i need some more functions.

    Litetween doesn't seem to be the right plugin for me :-|

    Thanks,

    TheMac

  • GameThirsty , thanks for the answer. I thought it was better to separate questions for a logic reason....

    Anyway, i checked the link you provided and i'll soon try it. Thanks !

    The script i'll have to insert is a simple google maps invocation showing current position of user . Like this :

    ----

    navigator.geolocation.getCurrentPosition (function (pos)

    {

    var lat = pos.coords.latitude;

    var lng = pos.coords.longitude;

    var myLatLng = new google.maps.LatLng(lat,lng);

                         

    var marker = new google.maps.Marker({

                     map: control.map,

                     position: myLatLng

                   });

    control.center = myLatLng;

    control.map.setCenter(myLatLng);

    });

    ---

    Hoping it will work. I'll report you soon . Thanks !

    TheMac

themacvictror's avatar

themacvictror

Member since 29 Dec, 2013

None one is following themacvictror yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies