I have an image that I used in my js file (it's used for a geolocation icon) and I would like to add css styling to it because the image itself is too large on the screen.
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
#map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var locationIcon = 'img/SVG/User_Location.svg';
// Try HTML5 geolocation.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
//Centers map to current position
map.setCenter(pos);
//Sets icon to current position
var currentLocation = new google.maps.Marker({
position: {lat: position.coords.latitude, lng: position.coords.longitude},
map: map,
icon: locationIcon
});
}, function() {
handleLocationError(true, infoWindow, map.getCenter());
});
} else {
// Browser doesn't support Geolocation
handleLocationError(false, infoWindow, map.getCenter());
}
}
</script>
</body>
</html>
How would I achieve this? EDIT: I added code to show how the image is displayed