ADD event to marker maps

i have just finish this guide http://devcenter.appery.io/tutorials/... and i have the maps with 3 marker how i can add event in the marker to navigate in another app page?
1 person has
this question
+1
This topic is no longer open for comments or replies.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned

  • i follow the post and now my code is:

    function log2(m){
    return ((Math.log(m)) / (Math.log(2)));
    }
    for (var k in value.geometry) {
    if (locationHelper.checkLocation(k)) {
    locationHelper.aLocations.push([value.geometry.location.lat, value.geometry.location.lng]);
    }
    }
    var maxLatitude = -90,
    minLatitude = 90,
    maxLongitude = -180,
    minLongitude = 180;
    for (i = 0; i < locationHelper.aLocations.length; i++) {
    maxLatitude = locationHelper.aLocations[i][0] > maxLatitude ? locationHelper.aLocations[i][0] : maxLatitude;
    minLatitude = locationHelper.aLocations[i][0] < minLatitude ? locationHelper.aLocations[i][0] : minLatitude;
    maxLongitude = locationHelper.aLocations[i][1] > maxLongitude ? locationHelper.aLocations[i][1] : maxLongitude;
    minLongitude = locationHelper.aLocations[i][1] < minLongitude ? locationHelper.aLocations[i][1] : minLongitude;
    }
    var map = new google.maps.Map(document.getElementsByName("multiGoogleMap")[0], {
    zoom: 5,
    center: new google.maps.LatLng((maxLatitude + minLatitude) / 2, (maxLongitude + minLongitude) / 2),
    mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    var BindMarker = function(marker, pageNagivateTo){
    google.maps.event.addListener(marker, 'click', function() {
    //Here is a code to specify page you want to navigate. You need to get it from marker or other way(from some data).
    var nextPage = pageNagivateTo ? pageNagivateTo : "Menuita";
    Apperyio.navigateTo(nextPage);
    });
    };

    var marker, i;
    for (i = 0; i < locationHelper.aLocations.length; i++) {
    marker = new google.maps.Marker({
    position: new google.maps.LatLng(locationHelper.aLocations[i][0], locationHelper.aLocations[i][1]),
    map: map,
    title: 'Modello Toyota (Chubu)',
    });
    BindMarker(marker, "Menuita");
    }

    but all 3 marker open the same page.
    how do I open different pages by individual markers?
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited sad, anxious, confused, frustrated

  • Hi Christian,

    This is because you set the same page for each marker:
    BindMarker(marker, "Menuita");
    You should pass different values for each marker in the second function parameter.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated happy, confident, thankful, excited kidding, amused, unsure, silly indifferent, undecided, unconcerned