Hi,
I have a ap with several markers, which are a specific width and height image file. But on the map the marker displays smaller than its original dimensions. Why would that be ?
Thank you.
Hi Roman,
Thank you for waiting.
During troubleshooting, I noticed that your map's marker images are not showing in the original size, because they are using ".svg" files.
WordPress currently doesn't officially support ".svg" files and it also can't calculate the width and heights of such files.
As a safe fallback, the Toolset Maps plugin adds a default width and height of 32 px, to the markers which are using ".svg" type files.
You'll find the code line that controls this at line# 546, in the file: "/toolset-maps/resources/js/wpv_addon_maps.js":
var scaledSize = new google.maps.Size(32, 32);
To control the size of the markers, you can:
1. Change the file type used for the markers to regular image files ( e.g. .jpeg or .png ), instead of ".svg" files.
OR
2. Change the value "32" in the actual plugin file, as needed.
( but you'll need to keep track of this edit, as future plugin updates will overwrite any changes )
regards,
Waqar
Thank you very much.
1- I must use SVG since I need the images colors to change based on a taxonomy.
2- Would it be possible to add this
var scaledSize = new google.maps.Size(27, 41);
to the JS loop generating the map ?
Thank you.
Hi Roman,
1- If you're only using SVG files so that you can change the image based on taxonomy, have you considered using conditional code blocks to load different images?
( ref: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/ )
2- If option 1 is not feasible than I'm afraid, you'll have to make a change to the original file in the plugin folder. That part of the code is not filterable or declarable from inside the view.
regards,
Waqar