vivo/productMods/js/visualization/mapofscience/CustomScimaps.js

78 lines
61 KiB
JavaScript
Raw Normal View History

/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var DISCIPLINES = {"11": {"labelLongitude": -85.72, "color": "#61FFE0", "image": "chemeng.png", "longitude": -74.53125, "label": "Chemical, Mechanical, & Civil Engineering", "labelLatitude": 37.3269, "latitude": 57.80419}, "10": {"labelLongitude": -75.078, "color": "#A61815", "image": "earthsci.png", "longitude": -52.734375, "label": "Earth Sciences", "labelLatitude": -37.3093, "latitude": -19.797}, "13": {"labelLongitude": -102.3125, "color": "#FF82FF", "image": "eecs.png", "longitude": -144.140625, "label": "Electrical Engineering & Computer Science", "labelLatitude": 71.559, "latitude": 75.89095}, "12": {"labelLongitude": -138.609, "color": "#A518FB", "image": "mathphys.png", "longitude": -129.375, "label": "Math & Physics", "labelLatitude": 83.64589, "latitude": 81.8504}, "1": {"labelLongitude": 101.5, "color": "#FFB52A", "image": "health.png", "longitude": 76.641, "label": "Health Professionals", "labelLatitude": 85.391988, "latitude": 83.2171}, "3": {"labelLongitude": 120.0, "color": "#FFF200", "image": "socsci.png", "longitude": 164.53125, "label": "Social Sciences", "labelLatitude": 46.0, "latitude": 61.69543}, "2": {"labelLongitude": -42.89, "color": "#1800FF", "image": "chem.png", "longitude": -45.7031, "label": "Chemistry", "labelLatitude": 84.49964, "latitude": 81.64863}, "5": {"labelLongitude": 123, "color": "#FF0000", "image": "brain.png", "longitude": 99.84375, "label": "Brain Research", "labelLatitude": 75.4636, "latitude": 68.7247}, "4": {"labelLongitude": 130.171, "color": "#D2ED3D", "image": "human.png", "longitude": 163.125, "label": "Humanities", "labelLatitude": -20.454179, "latitude": -14.42333}, "7": {"labelLongitude": 30.34375, "color": "#B8140B", "image": "infect.png", "longitude": 47.109375, "label": "Infectious Diseases", "labelLatitude": 49.80135, "latitude": 55.8819}, "6": {"labelLongitude": 30.914, "color": "#FF7D47", "image": "medspec.png", "longitude": 44.296875, "label": "Medical Specialties", "labelLatitude": 78.219528, "latitude": 71.36081}, "9": {"labelLongitude": 10.4375, "color": "#349803", "image": "bio.png", "longitude": -19.6875, "label": "Biology", "labelLatitude": -20.57634, "latitude": 1.593542}, "8": {"labelLongitude": -35.375, "color": "#00FF80", "image": "biotech.png", "longitude": 0.0, "label": "Biotechnology", "labelLatitude": 64.0934, "latitude": 48.58235}};
var SUBDISCIPLINES = {"344": {"latitude": 75.320025, "discipline": "11", "longitude": -92.109375, "label": "Printing"}, "345": {"latitude": 12.554564, "discipline": "9", "longitude": -16.875, "label": "Genetics"}, "346": {"latitude": 74.402163, "discipline": "11", "longitude": -94.21875, "label": "Industrial Chemistry"}, "347": {"latitude": 77.617709, "discipline": "6", "longitude": 56.25, "label": "Obesity"}, "340": {"latitude": 11.178402, "discipline": "9", "longitude": 8.4375, "label": "Parasitology"}, "341": {"latitude": 54.162434, "discipline": "6", "longitude": -1.40625, "label": "Dairy Science"}, "342": {"latitude": 42.55308, "discipline": "11", "longitude": -65.390625, "label": "Water Policy"}, "343": {"latitude": -7.013668, "discipline": "11", "longitude": -38.671875, "label": "Fish Research"}, "348": {"latitude": -21.943046, "discipline": "4", "longitude": 165.234375, "label": "Literary Criticism"}, "349": {"latitude": 31.952162, "discipline": "6", "longitude": 40.78125, "label": "Hepatology"}, "298": {"latitude": 84.865782, "discipline": "1", "longitude": 89.296875, "label": "AIDS Treatment"}, "299": {"latitude": 77.31252, "discipline": "13", "longitude": -140.625, "label": "Wireless Communication"}, "296": {"latitude": 67.609221, "discipline": "11", "longitude": -99.84375, "label": "Vehicle System Design"}, "297": {"latitude": 59.888937, "discipline": "7", "longitude": 35.859375, "label": "Transfusion"}, "294": {"latitude": 27.683528, "discipline": "9", "longitude": -21.09375, "label": "Crop Science"}, "295": {"latitude": 74.775843, "discipline": "13", "longitude": -148.359375, "label": "Fuzzy Sets"}, "292": {"latitude": 79.560546, "discipline": "6", "longitude": 74.53125, "label": "Hospice Care"}, "293": {"latitude": -2.811371, "discipline": "11", "longitude": -54.140625, "label": "Climatology"}, "290": {"latitude": 58.447733, "discipline": "3", "longitude": 157.5, "label": "Science Education"}, "291": {"latitude": 74.775843, "discipline": "12", "longitude": -156.09375, "label": "Design & Analysis of Algorithms"}, "199": {"latitude": 82.214217, "discipline": "2", "longitude": -68.203125, "label": "Catalysis"}, "198": {"latitude": 49.382373, "discipline": "3", "longitude": 168.046875, "label": "Political Geography"}, "195": {"latitude": 81.723188, "discipline": "2", "longitude": -23.203125, "label": "Atomic Spectrometry"}, "194": {"latitude": 80.647035, "discipline": "1", "longitude": 62.578125, "label": "Dental Research"}, "197": {"latitude": 84.865782, "discipline": "1", "longitude": 63.984375, "label": "Public Health Service"}, "196": {"latitude": 16.636192, "discipline": "9", "longitude": -22.5, "label": "Botany"}, "191": {"latitude": 80.872827, "discipline": "1", "longitude": 63.984375, "label": "Prosthetic Dentistry"}, "190": {"latitude": 57.704147, "discipline": "6", "longitude": 33.046875, "label": "Clinical Infectious Disease"}, "193": {"latitude": 74.959392, "discipline": "13", "longitude": -139.921875, "label": "Robotic Systems"}, "192": {"latitude": 79.812302, "discipline": "1", "longitude": 60.46875, "label": "Orthodontics"}, "270": {"latitude": 53.330873, "discipline": "3", "longitude": -179.296875, "label": "Agricultural Economics"}, "271": {"latitude": 65.366837, "discipline": "3", "longitude": 143.4375, "label": "Social Work"}, "272": {"latitude": 83.753911, "discipline": "1", "longitude": 80.15625, "label": "Medical Insurance"}, "273": {"latitude": 81.823794, "discipline": "11", "longitude": -76.640625, "label": "Fluid Phase Equilibrium"}, "274": {"latitude": 52.05249, "discipline": "8", "longitude": 7.734375, "label": "Biotechnology Trends"}, "275": {"latitude": -15.961329, "discipline": "11", "longitude": -58.359375, "label": "Air Quality"}, "276": {"latitude": 68.911005, "discipline": "13", "longitude": -168.046875, "label": "Search Engines; Web Crawling"}, "277": {"latitude": 82.214217, "discipline": "2", "longitude": -78.75, "label": "Colloid"}, "278": {"latitude": 76.351896, "discipline": "1", "longitude": 61.875, "label": "Applied Physiology; Muscle"}, "279": {"latitude": -21.943046,
var SCIMAP_TYPE = {
DISCIPLINE: "DISCIPLINE",
SUBDISCIPLINE: "SUBDISCIPLINE"
};
function getDisciplineLabelImageURL(key) {
return disciplineLabelImageUrlPrefix + DISCIPLINES[key].image;
}
function createScimapType(map, mapName) {
var sciMapTypeOptions = {
getTileUrl: function(coord, zoom) {
var normalizedCoord = getNormalizedCoord(coord, zoom);
if (!normalizedCoord) {
return mapOfScienceImageFolderPrefix + "tiles/blank.png";
}
var bound = Math.pow(2, zoom);
return mapOfScienceImageFolderPrefix + "tiles/tiles" + zoom + "_" + normalizedCoord.x + "_" +
normalizedCoord.y + ".png";
},
tileSize: new google.maps.Size(256, 256),
isPng: true,
minZoom: 1,
maxZoom: 4,
name: mapName
};
var sciMapType = new google.maps.ImageMapType(sciMapTypeOptions);
2011-07-09 17:35:59 +00:00
new CopyrightPanel ({
map: map,
controlPositions: google.maps.ControlPosition.BOTTOM_RIGHT,
2011-11-11 18:36:55 +00:00
html: '&copy; 2008 The Regents of the University of California and SciTech Strategies.<br>' +
'Map updated by <a href="http://mapofscience.com">SciTech Strategies</a>, ' +
'<a href="http://www.ost.uqam.ca/" title="Observatoire des sciences et des technologies">OST</a>, ' +
'and <a href="http://cns.iu.edu" title="CyberInfrastructure for Network Science">CNS</a> in 2010'
2011-07-09 17:35:59 +00:00
});
map.mapTypes.set(mapName, sciMapType);
}
//Normalizes the coords that tiles repeat across the x axis (horizontally)
// like the standard Google map tiles.
function getNormalizedCoord(coord, zoom) {
var y = coord.y;
var x = coord.x;
// tile range in one direction range is dependent on zoom level
// 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
var tileRange = 1 << zoom;
// don't repeat across y-axis (vertically)
if (y < 0 || y > customTileRange(zoom)) {
return null;
}
// repeat across x-axis (horizontal)
if (x < 0 || x >= tileRange) {
x = (x % tileRange + tileRange) % tileRange;
}
return {
x: x,
y: y
};
}
// horizontal range bound
function customTileRange(zoom) {
if (zoom < 3) {
return zoom;
} else if (zoom == 3){
return 4;
} else if (zoom == 4) {
return 9;
}
}