New home › Forums › Pro Add-on › General queries › Change marker icon on click
Tagged: custom marker
- This topic has 21 replies, 7 voices, and was last updated 1 year, 4 months ago by mdesign.
-
AuthorPosts
-
January 11, 2021 at 9:22 pm #66728adambradfordMember
Hi,
When a user clicks a marker to reveal the info window, is there a way to make the clicked marker icon change to a different image? (Basically the same except a different color?)
Then change back to normal status if the user clicks a different icon?
Thanks.
Adam.
January 12, 2021 at 9:07 am #66740AbelCModeratorHi Adam,
Thank you so much for getting in touch with us.
Unfortunately, this is not supported by default at the moment. We do apologize for the inconvenience.
With that said, this can be achieved with Custom JS.
Could I kindly ask if you could please provide us with a link to your map page?
Could you also please confirm the marker icon to be used when a user clicks on a marker?
I will then be able to provide you with Custom JS needed to achieve this.
I hope this helps clarify, and I look forward to hearing back from you.
Kind Regards,
AbelJanuary 12, 2021 at 9:12 am #66741adambradfordMemberThis reply has been marked as private.January 12, 2021 at 10:08 am #66742AbelCModeratorHi Adam,
Thank you for letting me know, and not a problem at all.
I look forward to hearing back from you and assisting you further.
Kind Regards,
AbelJanuary 12, 2021 at 3:02 pm #66796adambradfordMemberThis reply has been marked as private.January 12, 2021 at 3:05 pm #66797adambradfordMemberThis reply has been marked as private.January 13, 2021 at 9:12 am #66819AbelCModeratorHi There,
Thank you so much for getting back to me.
I will prepare the code needed to achieve this and get back to you as soon as possible.
Kind Regards,
AbelJanuary 13, 2021 at 2:36 pm #66834AbelCModeratorHi There,
Thank you for your time on this one.
I have now added the custom JS (Maps -> Settings -> Advanced Settings) needed to achieve this.
Could you please confirm if this is working for you?
I look forward to hearing back from you.
Kind Regards,
AbelJanuary 13, 2021 at 8:13 pm #66853adambradfordMemberHi Abel,
This is amazing! Thank you so much.
The only minor problem is that the swapped (yellow) image shows up as twice the dimensions of the regular one. The two files are identical in size – I suspect it is related to the fact that I ticked the “retina ready” box for the regular one, which effectively halves the dimensions of the image when displayed. Presumably we need to make some kind of similar provision in your JS ?
If this isn’t possible, as a workaround, I could simply swap the image file for one half the size! Would be nice to have the retina one though.
Thank you.
Adam.
- This reply was modified 2 years, 8 months ago by adambradford.
January 14, 2021 at 5:54 pm #66897AbelCModeratorHi Adam,
Thank you for letting me know.
Unfortunately, it is not supported to change the image size of the marker icon with custom JS at the moment.
Would it perhaps be possible to please upload a smaller image file and please confirm the URL to this new image?
Could I also kindly ask if you could please upload a smaller image of the default icon as this icon will then be used when the user closes the InfoWindow?
This will be a tremendous help!
I hope this helps clarify, and I look forward to hearing back from you.
Kind Regards,
AbelJanuary 18, 2021 at 11:40 am #66967adambradfordMemberThis reply has been marked as private.January 18, 2021 at 2:39 pm #66975adambradfordMemberThis reply has been marked as private.January 18, 2021 at 3:15 pm #66977AbelCModeratorThis reply has been marked as private.January 18, 2021 at 3:19 pm #66978adambradfordMemberThis reply has been marked as private.January 18, 2021 at 3:24 pm #66979AbelCModeratorHi Adam,
I have viewed your map page and it appears that you receive the following error in the console – Failed to load resource: net::ERR_NAME_NOT_RESOLVED.
This means that the marker icons is not displaying in the frontend. Could I kindly ask if you could please navigate to Maps -> Edit -> Advanced Settings -> Please re-upload the “Default Marker Image”.
Please do let me know if this resolves the issue you are currently experiencing?
I look forward to hearing back from you.
Kind Regards,
Abel -
AuthorPosts
- You must be logged in to reply to this topic.