|
var markers = []; var markerNames = [ "Bracia Zmartwychwstania - Galilea", "Męskie Plutony Różańca", "Mężczyźni Pustelni", "Mężczyźni Świętego Józefa", "Przymierze Wojowników", "W POŁOWIE DROGI", "Wspólnota Lew Judy" ];
// show icons for checkboxes
for (var i = 0; i < markerNames.length; i++)
{
document.getElementById("img" + i).src = categoryToIcon(markerNames[i]);
}
document.getElementById("imgInne").src = categoryToIcon("inny");
function categoryToIcon( cat )
{
switch (cat)
{
case markerNames[0]: return "http://labs.google.com/ridefinder/images/mm_20_purple.png";
case markerNames[1]: return "http://labs.google.com/ridefinder/images/mm_20_yellow.png";
case markerNames[2]: return "http://labs.google.com/ridefinder/images/mm_20_blue.png";
case markerNames[3]: return "http://labs.google.com/ridefinder/images/mm_20_white.png";
case markerNames[4]: return "http://labs.google.com/ridefinder/images/mm_20_green.png";
case markerNames[5]: return "http://labs.google.com/ridefinder/images/mm_20_red.png";
case markerNames[6]: return "http://labs.google.com/ridefinder/images/mm_20_brown.png";
default: return "http://labs.google.com/ridefinder/images/mm_20_gray.png";
}
}
function changeMarkers(idx, checked)
{
for (var i = 0; i < markers.length; i++)
{
catIdx = markerNames.indexOf(markers[i].category);
if (catIdx == idx) markers[i].setVisible(checked);
}
}
function mapInit()
{
var mapCenter = new google.maps.LatLng(51.9, 19.1);
var mapCanvas = document.getElementById("map");
var mapOptions = { center: mapCenter, zoom: 6};
var map = new google.maps.Map(mapCanvas, mapOptions);
var infowindow = new google.maps.InfoWindow();
var geocoder = new google.maps.Geocoder();
var missingLatLng = [];
var index = 0;
var timer;
for (var i = 0; i < jsonData.length; i++)
{
var info = jsonData[i];
if (info.lat != null && info.long != null)
{
addMarkerInfo(info);
}
}
function addMarkerInfo(info)
{
var marker = new google.maps.Marker({
position: { lat: info.lat, lng: info.long },
map: map,
title: info.nazwa,
icon: new google.maps.MarkerImage(categoryToIcon(info.siec))
});
marker.category = info.siec;
markers.push(marker);
google.maps.event.addListener(marker, "click", function () {
var content;
if (info.nazwa.length != 0) content = "" + info.nazwa + "";
if (info.miasto.length != 0) content += "
" + info.miasto;
if (info.parafia.length != 0) content += "
" + info.parafia;
if (info.diecezja.length != 0) content += "
Diecezja: " + info.diecezja;
if (info.termin.length != 0) content += "
Spotkania: " + info.termin;
if (info.lider.length != 0) content += "
Kontakt: " + info.lider;
if (info.kapelan.length != 0) content += "
Kapelan: " + info.kapelan;
if (info.lider.siec != 0) content += "
" + info.siec;
infowindow.setContent( content ); infowindow.open(map, marker); }); } }
Aby dopisać męską grupę wypełnij formularz