Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    58

    PAginazione marker google maps

    Buon giorno,

    Ho una tabella dati con i campi:
    Longitudine
    Latitudine
    foto
    descrizione

    Tramite le Api di google maps,
    GDownloadUrl("rssfeed_mappa.asp)

    recupero i dati long+lat dal database e visualizzo in una pagina del mio sito la mappa e sidebar nella quale vengono elencati foto e descrizione corrispondenti ai marker visualizzati nella mappa.

    Il problema è che se ho 1000 records, nella sidebar vengono visualizzati tutti.
    E' possibile paginare i dati nella sidebar in modo da visualizzare un tot alla volta.
    Per esempio 50 marker e i 50 records corrispondenti e poi cambiare pagina ?

    Grazie per risposta

  2. #2
    Utente di HTML.it
    Registrato dal
    Feb 2005
    Messaggi
    58

    Paginazione marker google maps

    Scusate ma sto cercando di fare delle prove.Sono altamente scarso in javascript.Vorrei chiedervi:

    In una pagina asp ho uno script tipo quello che posto che visualizza una mappa di google.I dati lon+lat inizialmente erano elencati :

    var point = new GLatLng(44.0136770228994,11.8212890625);
    var marker = createMarker(point)
    map.addOverlay(marker);


    Io ho fatto una pagina asp (mappa.asp)che preleva i dati da un db e li stampa come da codice iniziale sopra indicato.
    E' possibile inserire all'interno dello script delle righe in asp che listano il recordset ?
    Io ho provato con
    e sembra funzionare .
    Se si può fare è corretta questa sintassi ?

    Potete aiutarmi

    <script type="text/javascript">
    //<![CDATA[

    if (GBrowserIsCompatible()) {

    // this variable will collect the html which will eventualkly be placed in the side_bar
    var side_bar_html = "";

    // arrays to hold copies of the markers and html used by the side_bar
    // because the function closure trick doesnt work there
    var gmarkers = [];


    // A function to create the marker and set up the event window
    function createMarker(point,name,html) {
    // use a custom icon with letter A - Z
    var letter = String.fromCharCode("A".charCodeAt(0) + (gmarkers.length));
    var myIcon = new GIcon(G_DEFAULT_ICON, "http://www.google.com/mapfiles/marker" + letter + ".png");
    myIcon.printImage = "http://maps.google.com/mapfiles/marker"+letter+"ie.gif"
    myIcon.mozPrintImage = "http://maps.google.com/mapfiles/marker"+letter+"ff.gif"

    var marker = new GMarker(point, {icon:myIcon});
    GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
    });
    // save the info we need to use later for the side_bar
    gmarkers.push(marker)
    // add a line to the side_bar html
    side_bar_html += '[b]'+letter+'<\/b> <a href="javascript:myclick(' + (gmarkers.length-1) + ')">' + name + '<\/a>
    ';
    return marker;
    }


    // This function picks up the click and opens the corresponding info window
    function myclick(i) {
    GEvent.trigger(gmarkers[i], "click");
    }


    // create the map
    var map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
    map.setCenter(new GLatLng( 43.907787,-79.359741), 8);





    // put the assembled side_bar_html contents into the side_bar div
    document.getElementById("side_bar").innerHTML = side_bar_html;

    }

    else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
    }

    // This Javascript is based on code provided by the
    // Blackpool Community Church Javascript Team
    // http://www.commchurch.freeserve.co.uk/
    // http://econym.googlepages.com/index.htm

    //]]>
    </script>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.