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

82 lines
66 KiB
JavaScript
Raw Normal View History

/* $This file is distributed under the terms of the license in /doc/license.txt$ */
var DISCIPLINES = {"11": {"labelLongitude": -154.60900000000001, "color": "#A819FA", "image": "mathphys.png", "longitude": -129.375, "label": "Math & Physics", "labelLatitude": 82.645889999999994, "latitude": 81.850399999999993}, "10": {"labelLongitude": 30.34375, "color": "#B8150B", "image": "infect.png", "longitude": 47.109375, "label": "Infectious Diseases", "labelLatitude": 49.801349999999999, "latitude": 55.881900000000002}, "13": {"labelLongitude": 120.0, "color": "#FFFF00", "image": "socsci.png", "longitude": 164.53125, "label": "Social Sciences", "labelLatitude": 46.0, "latitude": 61.695430000000002}, "12": {"labelLongitude": 101.5, "color": "#FF804D", "image": "health.png", "longitude": 76.641000000000005, "label": "Health Professionals", "labelLatitude": 84.591988000000001, "latitude": 83.217100000000002}, "1": {"labelLongitude": 10.4375, "color": "#379908", "image": "bio.png", "longitude": -19.6875, "label": "Biology", "labelLatitude": -20.576339999999998, "latitude": 1.593542}, "3": {"labelLongitude": 30.914000000000001, "color": "#FF0000", "image": "medspec.png", "longitude": 44.296875, "label": "Medical Specialties", "labelLatitude": 78.219527999999997, "latitude": 71.360810000000001}, "2": {"labelLongitude": -35.375, "color": "#00FF80", "image": "biotech.png", "longitude": 0.0, "label": "Biotechnology", "labelLatitude": 64.093400000000003, "latitude": 48.582349999999998}, "5": {"labelLongitude": -42.890000000000001, "color": "#0000FF", "image": "chem.png", "longitude": -45.703099999999999, "label": "Chemistry", "labelLatitude": 85.499639999999999, "latitude": 81.648629999999997}, "4": {"labelLongitude": -63.719999999999999, "color": "#61FFFF", "image": "chemeng.png", "longitude": -74.53125, "label": "Chemical, Mechanical, & Civil Engineering", "labelLatitude": 37.326900000000002, "latitude": 57.804189999999998}, "7": {"labelLongitude": -102.3125, "color": "#FF85FF", "image": "eecs.png", "longitude": -144.140625, "label": "Electrical Engineering & Computer Science", "labelLatitude": 71.558999999999997, "latitude": 75.890950000000004}, "6": {"labelLongitude": -75.078000000000003, "color": "#A71916", "image": "earthsci.png", "longitude": -52.734375, "label": "Earth Sciences", "labelLatitude": -37.3093, "latitude": -19.797000000000001}, "9": {"labelLongitude": 130.17099999999999, "color": "#FFFF80", "image": "human.png", "longitude": 163.125, "label": "Humanities", "labelLatitude": -20.454179, "latitude": -14.42333}, "8": {"labelLongitude": 75.078000000000003, "color": "#FFB529", "image": "brain.png", "longitude": 99.84375, "label": "Brain Research", "labelLatitude": 64.4636, "latitude": 68.724699999999999}};
2012-07-10 21:53:55 +00:00
var SUBDISCIPLINES = {"344": {"latitude": 75.320025000000001, "discipline": "4", "longitude": -92.109375, "label": "Printing"}, "345": {"latitude": 12.554563999999999, "discipline": "1", "longitude": -16.875, "label": "Genetics"}, "346": {"latitude": 74.402163000000002, "discipline": "4", "longitude": -94.21875, "label": "Industrial Chemistry"}, "347": {"latitude": 77.617709000000005, "discipline": "12", "longitude": 56.25, "label": "Obesity"}, "340": {"latitude": 11.178402, "discipline": "1", "longitude": 8.4375, "label": "Parasitology"}, "341": {"latitude": 54.162433999999998, "discipline": "10", "longitude": -1.40625, "label": "Dairy Science"}, "342": {"latitude": 42.553080000000001, "discipline": "4", "longitude": -65.390625, "label": "Water Policy"}, "343": {"latitude": -7.013668, "discipline": "1", "longitude": -38.671875, "label": "Fish Research"}, "348": {"latitude": -21.943045999999999, "discipline": "9", "longitude": 165.234375, "label": "Literary Criticism"}, "349": {"latitude": 31.952162000000001, "discipline": "3", "longitude": 40.78125, "label": "Hepatology"}, "298": {"latitude": 84.865781999999996, "discipline": "12", "longitude": 89.296875, "label": "AIDS Treatment"}, "299": {"latitude": 77.312520000000006, "discipline": "7", "longitude": -140.625, "label": "Wireless Communication"}, "296": {"latitude": 67.609221000000005, "discipline": "4", "longitude": -99.84375, "label": "Vehicle System Design"}, "297": {"latitude": 59.888936999999999, "discipline": "3", "longitude": 35.859375, "label": "Transfusion"}, "294": {"latitude": 27.683527999999999, "discipline": "1", "longitude": -21.09375, "label": "Crop Science"}, "295": {"latitude": 74.775842999999995, "discipline": "7", "longitude": -148.359375, "label": "Fuzzy Sets"}, "292": {"latitude": 79.560546000000002, "discipline": "12", "longitude": 74.53125, "label": "Hospice Care"}, "293": {"latitude": -2.8113709999999998, "discipline": "6", "longitude": -54.140625, "label": "Climatology"}, "290": {"latitude": 58.447732999999999, "discipline": "13", "longitude": 157.5, "label": "Science Education"}, "291": {"latitude": 74.775842999999995, "discipline": "11", "longitude": -156.09375, "label": "Design & Analysis of Algorithms"}, "199": {"latitude": 82.214217000000005, "discipline": "5", "longitude": -68.203125, "label": "Catalysis"}, "198": {"latitude": 49.382373000000001, "discipline": "13", "longitude": 168.046875, "label": "Political Geography"}, "195": {"latitude": 81.723187999999993, "discipline": "5", "longitude": -23.203125, "label": "Atomic Spectrometry"}, "194": {"latitude": 80.647035000000002, "discipline": "12", "longitude": 62.578125, "label": "Dental Research"}, "197": {"latitude": 84.865781999999996, "discipline": "12", "longitude": 63.984375, "label": "Public Health Service"}, "196": {"latitude": 16.636192000000001, "discipline": "1", "longitude": -22.5, "label": "Botany"}, "191": {"latitude": 80.872827000000001, "discipline": "12", "longitude": 63.984375, "label": "Prosthetic Dentistry"}, "190": {"latitude": 57.704146999999999, "discipline": "3", "longitude": 33.046875, "label": "Clinical Infectious Disease"}, "193": {"latitude": 74.959391999999994, "discipline": "7", "longitude": -139.921875, "label": "Robotic Systems"}, "192": {"latitude": 79.812302000000003, "discipline": "12", "longitude": 60.46875, "label": "Orthodontics"}, "270": {"latitude": 53.330872999999997, "discipline": "13", "longitude": -179.296875, "label": "Agricultural Economics"}, "271": {"latitude": 65.366837000000004, "discipline": "13", "longitude": 143.4375, "label": "Social Work"}, "272": {"latitude": 83.753911000000002, "discipline": "12", "longitude": 80.15625, "label": "Medical Insurance"}, "273": {"latitude": 81.823794000000007, "discipline": "4", "longitude": -76.640625, "label": "Fluid Phase Equilibrium"}, "274": {"latitude": 52.052489999999999, "discipline": "2", "longitude": 7.734375, "label": "Biotechnology Trends"}, "275": {"latitude": -15.961328999999999, "discipline": "6", "longitude": -58.359375, "label": "Air Quality"}, "276": {"latitude": 68.911005000000003, "
var SCIMAP_TYPE = {
DISCIPLINE: "DISCIPLINE",
SUBDISCIPLINE: "SUBDISCIPLINE"
};
function getDisciplineLabelImageURL(key) {
return disciplineLabelImageUrlPrefix + DISCIPLINES[key].image;
}
function getDisciplineBlackLabelImageURL(key) {
return disciplineBlackLabelImageUrlPrefix + 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 2011.'
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;
}
}