var map;
var locmgr;
var baseicon = new GIcon();
baseicon.image = "/images/mapicons/mm_20_red.png";
baseicon.shadow = "/images/mapicons/mm_20_shadow.png";
baseicon.iconSize = new GSize(12, 20);
baseicon.shadowSize = new GSize(22, 20);
baseicon.iconAnchor = new GPoint(6, 20);
baseicon.infoWindowAnchor = new GPoint(5, 1);
var stateicon = new GIcon(baseicon);
stateicon.image = "/images/mapicons/icon491.png";
stateicon.shadow = "/images/mapicons/icon49s1.png";
stateicon.iconSize=new GSize(16,16);
stateicon.shadowSize=new GSize(28,16);
stateicon.iconAnchor=new GPoint(7,11);
stateicon.infoWindowAnchor=new GPoint(8,8);
var locicon = new GIcon(baseicon);
locicon.image = "/images/mapicons/mm_20_green.png";
var criteria = '';
function start(){
var temp;
}
//Loads the list of locations and links to state summaries into the sidebar
//Requires state, should also utilize species and user to limit results
function get_popular_states(state){
document.getElementById("subcontent").innerHTML='
';
var temp;
//temp = 'state=' + state + '&' + criteria.substring(1,criteria.length);
temp = criteria;
$.ajax({
//url: "/get_popular_states.php",
url:"/get_xml/get_StateLocList/"+state+"/"+criteria,
//data: temp,
success: function(msg){
document.getElementById("subcontent").innerHTML=msg;
//TB_init();
}
});
}
// returns the list of state centers in xml format
//used to put markers on map and create list of state links
// can use species or user to limit results
/*
function get_state_centers(criteria){
$.ajax({
url: "/getstatecenters.php",
data: criteria,
success: function(msg){
document.getElementById("content").innerHTML=msg;
}
});
}
*/
//returns list of current sightings and summary information for a locations
//why are we passing description instead of the location ID, could theoretcially have the
//same description for multiple locations??
//Pass both/ or have the php file grab the description
//where else is this calleD?
function get_location_sightings(locID,description){
document.getElementById("subcontent").innerHTML='
';
var temp;
/*
if(species >0){
temp = 'state='+state+'&Description='+description+'&species_id='+species;
}else{
temp = 'state='+state+'&Description='+description;
}
*/
temp = 'RBALocationsID=' + locID + '&Description='+description + "&" + criteria.substring(1,criteria.length);;
$.ajax({
url: "/get_xml/get_LocSightings/"+locID+"/"+criteria,
//data: temp,
success: function(msg){
document.getElementById("subcontent").innerHTML=msg;
//alert("test1");
//tb_init();
//alert("test");
tb_init('a.thickbox, area.thickbox, input.thickbox');
}
});
}
function updateZoomsState(){
var temp;
temp = 'Return to default view ';
document.getElementById("zooms").innerHTML=temp;
}
function updateZoomsLocation(Lat,Lon,Prec){
var temp;
temp = 'Return to default view / ';
temp += 'Return to State View';
document.getElementById("zooms").innerHTML=temp;
}
function zoomState(Lat,Lon,Prec,state,statename){
zoomPoint(Lat,Lon,Prec);
get_popular_states(statename);
getstatelocs(statename);
//updateZoomsState(Lat,Lon,Prec)
}
function zoomLocation(Lat,Lon,Prec,state,description){
zoomPoint(Lat,Lon,Prec);
get_location_sightings(state);
//updateZoomsLocation(Lat,Lon,Prec)
}
function zoomPoint(Lat,Lon,Prec){
map.closeInfoWindow();
newpoint = new GLatLng(parseFloat(Lat),parseFloat(Lon));
map.setCenter(newpoint,Prec);
map.setZoom(Prec);
}
function createStateMarker(point,theid,title,x,y,prec) {
var marker = new GMarker(point,{title:title, icon:stateicon});
var html = '