Keresés

Új hozzászólás Aktív témák

  • Sk8erPeter

    nagyúr

    válasz papa019 #2595 üzenetére

    Így van, de itt van is egy példa, a for ciklus a lényeg, ott épp használja a getAt() függvényt:

    function showArrays(event) {

    // Since this Polygon only has one path, we can call getPath()
    // to return the MVCArray of LatLngs
    var vertices = this.getPath();

    var contentString = "<b>Bermuda Triangle Polygon</b><br />";
    contentString += "Clicked Location: <br />" + event.latLng.lat() + "," + event.latLng.lng() + "<br />";

    // Iterate over the vertices.
    for (var i =0; i < vertices.length; i++) {
    var xy = vertices.getAt(i);
    contentString += "<br />" + "Coordinate: " + i + "<br />" + xy.lat() +"," + xy.lng();
    }

    // Replace our Info Window's content and position
    infowindow.setContent(contentString);
    infowindow.setPosition(event.latLng);

    infowindow.open(map);
    }

    A leírás meg szintén ezt mondja:

    "Polygon Arrays

    A polygon specifies its series of coordinates as an array of arrays, where each array is of type MVCArray. Each "leaf" array is an array of LatLng coordinates specifying a single path. To retrieve these coordinates, call the Polygon's getPaths() method. Since the array is an MVCArray you will need to manipulate and inspect it using the following operations:

    » getAt() returns the LatLng at a given zero-based index value.
    » insertAt() inserts a passed LatLng at a given zero-based index value. Note that any existing coordinates at that index value are moved forward.
    » removeAt() removes a LatLng at a given zero-based index value.

    Note: you cannot simply retrieve the ith element of an array by using the syntax mvcArray[I]; you must use mvcArray.getAt(i)."

    =============================

    A PHP-s részre:
    az escape-elésről és PDO-témáról nemrég diskuráltunk: [link], [link]

    ==
    Mondjuk akkor esélyes, hogy ez is új lesz.
    Látom valszeg valami adatbázis-wrappert használsz (bár esélyes, hogy nem használod ki a lehetőségeit), de nem látok bele a működésébe. A PDO használata indokolt lehet.

Új hozzászólás Aktív témák

Hirdetés