New home › Forums › Pro Add-on › Troubleshooting › map is not responsive
Tagged: responsive
- This topic has 14 replies, 3 voices, and was last updated 5 years, 4 months ago by McN.
-
AuthorPosts
-
January 24, 2018 at 5:15 pm #34034pshudginsMember
Hello, love the product, but it doesn’t appear to be responsive on my site. I have it set to 100% in the settings, but when I view it on mobile, I can see very little of the map, and very few markers. How can I fix this? Thank you.
Home
January 25, 2018 at 11:44 am #34056PerryModeratorHi there
Thanks for getting in touch, and thank you for your kind words 🙂
Can you please link me to the page in question?
Kind regards
– PerryJanuary 25, 2018 at 11:52 am #34057PerryModeratorI beg your pardon,
I skimmed over the link in your post.
I had a look just now on my Samsung A5 using Chrome and the map looked exactly how I would expect. It fills the screen and the markers are clearly visible.
Please see my attachment.
If this isn’t the case on your device, please let me know what device and browser you are using and we’ll run some simulations if possible.
Please let me know?
Kind regards
– PerryAttachments:
You must be logged in to view attached files.January 25, 2018 at 5:11 pm #34066pshudginsMemberIs there no way to view all of the USA, like on the desktop? I want visitors to be able to see all of the markers, not just a certain section of the country. Thanks
January 26, 2018 at 9:48 am #34084PerryModeratorHi there
One possibility would be to add some Javascript to programatically adjust the zoom based on some condition – for instance the device being in portrait orientation.
You could do this through a 3rd party custom JS plugin (I can recommend Simple Custom CSS & JS)
If you need me to make up the code for you I’d be happy to provide that.
Please let me know?
Kind regards
– PerryJanuary 26, 2018 at 6:53 pm #34112pshudginsMemberYes, please – would love the code, thanks.
January 29, 2018 at 9:16 am #34141PerryModeratorHi there,
Please use the following:
(function($) { $(document).ready(function(event) { if($(window).width() < $(window).height()) { for(var map_id in MYMAP) { // You can change 2 to a value of your choice MYMAP[map_id].map.setZoom( 2 ); } } }); })(jQuery);
If that has no effect please let me know, it may be necessary to delay that slightly depending on the load order. Please choose to add that in the footer if you use Simple Custom CSS & JS.
Let me know if that works for you?
Kind regards
– PerryJanuary 29, 2018 at 5:27 pm #34167pshudginsMemberThanks, I added it in, but it doesn’t seem to have an affect… looks like the code does load before the map code, so I”m not sure if that’s the issue? http://www.caddienow.com is the URL with the map. Thank you for any additional ideas
January 30, 2018 at 9:17 am #34190PerryModeratorHi there,
Try adding a delay on it like so
(function($) { $(document).ready(function(event) { setTimeout(function() { if($(window).width() < $(window).height()) { for(var map_id in MYMAP) { // You can change 2 to a value of your choice MYMAP[map_id].map.setZoom( 2 ); } } }, 500); }); })(jQuery);
Does that help?
Kind regards
– PerryJanuary 30, 2018 at 11:36 pm #34217pshudginsMemberHmmm… no, that didn’t seem to help. I’m pasting it in exactly as you have it… I’m not supposed to change anything, correct?
You can test here: http://www.caddienow.com
February 6, 2018 at 8:51 pm #34456pshudginsMemberHi, checking in again to see if you have any additional ideas. Please let me know, thanks.
February 7, 2018 at 9:27 am #34468PerryModeratorHi there,
There is a syntax error in the code on your site that’s been introduced at some point between the forum and pasting the code in,
Please change < to a lesser-than sign (<) If you're still experiencing issues, would it be possible for you to provide me with temporary login details? Kind regards - Perry
February 7, 2018 at 5:01 pm #34488pshudginsMemberThank you! That did the trick! Really appreciate the assistance.
February 7, 2018 at 5:25 pm #34489PerryModeratorThis reply has been marked as private. -
AuthorPosts
- You must be logged in to reply to this topic.