MapBox Icon SVG size on hover/click

Hello Experts,
I hope somone can help.... I am using MapBox for one of my projects with 3 layers for each POI type. Each POI layer using a custom icon SVG I uploaded via the MapBox Studio.
I am showing a popup when the user click on each POI and the popup is position fixed on the Map.
Currently the size of the icon SVG is set at 0.75. I need somehow to increase the size of the icon or replace the icon (what ever is easier) when the user click or mouseover each POI.
Below is my current script:

mapboxgl.accessToken = 'xyz'; 
	 var geojson = {
		type: 'FeatureCollection',
		features: [{
			type: 'Feature',
				geometry: {
					type: 'Point',
					coordinates: [19.225290,56.551136]

		var map = new mapboxgl.Map({
			container: 'map',
			style: 'mapbox://styles/xyz/cjk4c9eaj2tv22rqp316keuaq',
			center: [19.225290,56.545136], // starting position [lng, lat]
			zoom: 13.5,
			scrollZoom: false,
			pitch: 10,

var lastZoom = map.getZoom();

map.on('zoom', function() {
  const currentZoom = map.getZoom();
  if (currentZoom < 13 || currentZoom > 14) {
  } else {

  lastZoom = currentZoom;

map.on('load', function() {
	var layers = ['slf-urban', 'slf-land', 'slf-park'];

	var layer = $('#map-filters input[type="checkbox"]').on("change", function(c) {
		var thislayer = $(this).attr("id");
		if(thislayer == "slf-all") {
			for (var i = 0; i < layers.length; i++) {
		  	map.setLayoutProperty(layers[i], "visibility", "visible");
				$("#map-filters li").not(".slf-all").removeClass("selected");
				$("#map-filters li.slf-all").addClass("selected");
		} else {	
			for (var i = 0; i < layers.length; i++) {
			map.setLayoutProperty(layers[i], "visibility", "none");
				$("#map-filters li").removeClass("selected");
				var thisInput = $(this).parent();
				map.setLayoutProperty(thislayer, "visibility", "visible");
	// add markers to map
	geojson.features.forEach(function(marker) {
		// create a HTML element for each feature
		var el = document.createElement('div');
		el.className = 'marker';
		// make a marker for each feature and add to the map
		new mapboxgl.Marker(el)

var layersId = ['slf-urban', 'slf-land', 'slf-park'];

for (var i = 0; i < layersId.length; i++) {
    var layerId = layersId[i];

	map.on('click', layerId, function (e) {
		var coordinates = e.features[0].geometry.coordinates.slice();
		var address = e.features[0].properties.address;
		var category = e.features[0].properties.category;
		var description = e.features[0].properties.description;
		var name = e.features[0].properties.place_name;
		var photo = e.features[0];

		// Ensure that if the map is zoomed out such that multiple
		// copies of the feature are visible, the popup appears
		// over the copy being pointed to.
		while (Math.abs(e.lngLat.lng - coordinates[0]) > 180) {
				coordinates[0] += e.lngLat.lng > coordinates[0] ? 360 : -360;

		new mapboxgl.Popup({closeOnClick: true, closeButton: true})
			.setHTML('<div class="lagepop '+category+'"><h1>'+name+'</h1><p>'+description+'</p><p>'+address+'</p><div class="location-photo"><img src="'+photo+'"></div></div>')		 

map.addControl(new mapboxgl.FullscreenControl());
// Add zoom and rotation controls to the map.
map.addControl(new mapboxgl.NavigationControl({
	// Hide rotation control.
	showCompass: false
}), 'top-right');

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RefaelAuthor Commented:
Hi leakim97111 :-)
I already read the documentation on mapbox yet have not yes found what I am after. Or did yo find there a solution?
if I understand you, you want to do something like this (the big one) :

the big one
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

RefaelAuthor Commented:
Hi leakim971, Thank you!

It is very simple. I already have the map with custom icons (poi's). the only think i am searching of is how to integrate a mouse-over effect such as increasing the icons size or replacing the icon e.g. referencing a new icon (svg) on mouse over. Since I use the mapbox studio together with the script i have attached in my initial post i have no clue how to do it. I hope i clarify the question?
If it look like the screenshot I posted, you can use jQuery to find the icon and change the URL on mouse over

RefaelAuthor Commented:
leakim971 hi
I thought you said you do not really know mapbox? This script you sent is using leaflet js library. it is not really helpful, sorry.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.