Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Missing Map Icons #482

Merged
merged 2 commits into from Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/main/webapp/encounters/encounter.jsp
Expand Up @@ -123,6 +123,9 @@
}
%>
<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" />

Expand All @@ -132,6 +135,7 @@
<!-- Select2 JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.8/js/select2.min.js" defer></script>


<%


Expand Down Expand Up @@ -1301,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: " ",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am guessing the space must be needed here (versus just dropping the icon element from the json entirely).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the space is needed according to some reading I did on this issue. But I also didn't test without it.

position:latLng,
map:map
map:map,
label: {
text: "\ue0c8",
fontFamily: "Material Symbols Outlined",
color: "<%=haploColor %>",
fontSize: "36px",

}
});

<%
Expand Down Expand Up @@ -1453,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
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 @@ -68,6 +68,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 @@ -219,9 +220,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