28 cze 2010

Wyszukiwanie elementów tablicy po nazwie

var name='polska';
markersArray=[];
name=name.toLowerCase();
for (var i=0; i<markers.length; i++)
{
 if( markers[i].s==1 &&
 markers[i].title.toLowerCase().indexOf(name)!=-1)
 {
  var marker=newMarker(new GLatLng(markers[i].g, markers[i].l), markers[i].id, markers[i].title, markers[i].c);
  markersArray.push(marker);
 } 
}
28 cze 2010

Wyszukiwanie elementów tablicy po nazwie

var name='polska';
markersArray=[];
name=name.toLowerCase();
for (var i=0; i<markers.length; i++)
{
 if( markers[i].s==1 &&
 markers[i].title.toLowerCase().indexOf(name)!=-1)
 {
  var marker=newMarker(new GLatLng(markers[i].g, markers[i].l), markers[i].id, markers[i].title, markers[i].c);
  markersArray.push(marker);
 } 
}
28 cze 2010

Rysowanie boxa na mapie

function rysowanieBoxa() {
 if (boxes != null) {
  for (var i = 0; i < boxes.length; i++) {
   var vertices = [
   boxes[i].getSouthWest(),
   new GLatLng(boxes[i].getSouthWest().lat(),
    boxes[i].getNorthEast().lng()),
   boxes[i].getNorthEast(),
   new GLatLng(boxes[i].getNorthEast().lat(),
    boxes[i].getSouthWest().lng()),
   boxes[i].getSouthWest()
   ];
   var polygon = new GPolyline(vertices, '#ff0000', 1, 1.0);
   map.addOverlay(polygon);
  }
 }
}