Skip Navigation

[Resolved] Force marker to keep original size

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 5 years, 7 months ago.

Assisted by: Waqar.

Author
Posts
#1229243

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.

#1229334

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

#1229401

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.

#1229845

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