Skip to content

Commit

Permalink
Merge pull request #482 from WildMeOrg/update-google-maps
Browse files Browse the repository at this point in the history
Fixes Missing Map Icons
# Conflicts:
#	src/main/webapp/encounters/encounter.jsp
  • Loading branch information
holmbergius committed Apr 24, 2024
1 parent ec4c68d commit 1714c3f
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 13 deletions.
39 changes: 35 additions & 4 deletions src/main/webapp/encounters/encounter.jsp
Expand Up @@ -124,6 +124,18 @@
%>
<link type='text/css' rel='stylesheet' href='../javascript/timepicker/jquery-ui-timepicker-addon.css' />

<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,1,0" />

<!-- Select2 CSS -->
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-beta.1/dist/css/select2.min.css" rel="stylesheet" />

<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

<!-- Select2 JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.8/js/select2.min.js" defer></script>


<%
Expand Down Expand Up @@ -1293,9 +1305,17 @@ if(CommonConfiguration.showProperty("showCountry",context)){
%>
marker = new google.maps.Marker({
icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=haploColor%>',
//icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=haploColor%>',
icon: " ",
position:latLng,
map:map
map:map,
label: {
text: "\ue0c8",
fontFamily: "Material Symbols Outlined",
color: "<%=haploColor %>",
fontSize: "36px",
}
});
<%
Expand Down Expand Up @@ -1445,9 +1465,16 @@ if(CommonConfiguration.showProperty("showCountry",context)){
emptyMarkers();
var newLatLng = new google.maps.LatLng($('#lat').val(), $('#longitude').val());
var newMarker = new google.maps.Marker({
icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=haploColor%>',
//icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=haploColor%>',
icon: " ",
position:newLatLng,
map:map
map:map,
label: {
text: "\ue0c8",
fontFamily: "Material Symbols Outlined",
color: "<%=haploColor %>",
fontSize: "36px",
}
});
markers.push(newMarker);
}
Expand Down Expand Up @@ -1696,6 +1723,10 @@ function resetIdButtons() {
}
$(document).ready(function() {
$('#selectCode').select2({width: '100%', height:'50px'});
$('#selectCountry').select2({width: '100%', height:'50px'});
populateNewIndWithDisabledButton();
populateAddToExistingIndWithDisabledButton();
setUpIdActionOnClick();
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/encounters/mappedSearchResults.jsp
Expand Up @@ -75,6 +75,7 @@
%>


<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,1,0" />


<style type="text/css">
Expand Down
13 changes: 11 additions & 2 deletions src/main/webapp/individualMapEmbed.jsp
Expand Up @@ -85,6 +85,7 @@ context=ServletUtilities.getContext(request);
<script type="text/javascript" src="javascript/markerclusterer/markerclusterer.js"></script>
<script type="text/javascript" src="https://cdn.rawgit.com/googlemaps/js-marker-clusterer/gh-pages/src/markerclusterer.js"></script>
<script src="javascript/oms.min.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,1,0" />
<p><strong><%=mapping %></strong></p>
<%
int havegpsSize=haveGPSData.size();
Expand Down Expand Up @@ -236,9 +237,17 @@ String lastLatLong="";
}
%>
var marker = new google.maps.Marker({
icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=colorToUseForMarker%>',
//icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=colorToUseForMarker%>',
icon: " ",
position:latLng,
map:map<%=zIndexString%>
map:map<%=zIndexString%>,
label: {
text: "\ue0c8",
fontFamily: "Material Symbols Outlined",
color: "<%=colorToUseForMarker %>",
fontSize: "36px",
}
});
<%
String encSubdir = thisEnc.subdir();
Expand Down
1 change: 1 addition & 0 deletions src/main/webapp/individualMappedSearchResults.jsp
Expand Up @@ -72,6 +72,7 @@
%>


<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@48,400,1,0" />


<style type="text/css">
Expand Down
23 changes: 16 additions & 7 deletions src/main/webapp/javascript/GeoJSON.js
Expand Up @@ -10,20 +10,29 @@ var GeoJSON = function( geojson, options, map, bounds,aspect ){
opts.position = new google.maps.LatLng(geojsonGeometry.coordinates[1], geojsonGeometry.coordinates[0]);
googleObj = new google.maps.Marker(opts);

googleObj.setIcon(' ');
var pinColor=geojsonGeometry.color;

if(aspect == "sex"){
googleObj.setIcon('https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|'+geojsonGeometry.sexColor);
//googleObj.setIcon('https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|'+geojsonGeometry.sexColor);
pinColor=geojsonGeometry.sexColor;
}
else if(aspect == "haplotype"){
googleObj.setIcon('https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|'+geojsonGeometry.haplotypeColor);
//googleObj.setIcon('https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|'+geojsonGeometry.haplotypeColor);
pinColor=geojsonGeometry.haplotypeColor;
}
else if(aspect == "species"){
googleObj.setIcon('https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|'+geojsonGeometry.speciesColor);
}
else{
googleObj.setIcon('https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|'+geojsonGeometry.color);
//googleObj.setIcon('https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=|'+geojsonGeometry.speciesColor);
pinColor=geojsonGeometry.speciesColor;
}


var labelText={
text: '\ue0c8',
fontFamily: 'Material Symbols Outlined',
color: pinColor,
fontSize: '36px'
};
googleObj.set("label",labelText);

//reset bounds
bounds.extend(googleObj.getPosition());
Expand Down

0 comments on commit 1714c3f

Please sign in to comment.