Can map be centered?
-
The plugin works just fine but I cant center the map.
Here is the site: http://soscm.x10host.com/
Thanks
-
I’ve managed it with this but i’m not sure the syntax is quite right – it does work though and centres the map on the page (using the shortcode from the premium version)
code on the page:
<span class=”gmw-shortcode-widget”></span>[gmw id=”2″]
CSS:
.gmw-shortcode-widget {
text-align:center;
}If I put the shortcode between the <span> tags it doesn’t centre it. The line space between the <span> line and the shortcode is necessary
Any advice welcome as I’m sure there must be a more elegant way to write the code ? 🙂
ThanksIm using the free version not premium so this wont work for me. Weird it does not center by default
Hi,
The widget is only as wide as the map is, so from the widget’s perspective, there’s nothing to center. This is a theme thing. What you wrote above is good and will work. There’s no other, more elegant way 🙂 You simply centered the content within the container.Thanks for your reply. The thing is I am not using the Premium Version so I have no short code to work with. Just the widget area.
You’re welcome.
Yes and no. It is different but adding to code you noted above will still work with the setup you have at the moment.OK I will try and then get back to you
No problem. Reopen the ticket if necessary.
Hello again. I tried the code but no go. I tried to make the map wider but that doesn’t work either even though the theme is set to wide format.
I think you are correct. Must be something with my theme
For me, the map is centered on your site.
Actually I just got it to work.
I used this code which I modified the .css and added to custom code section of the theme.
.business-template .main-wrapper .widget {
background-color: #ffffff;
width: 500px;
margin: 0 auto;
}Now my only issue is I wish I could have it a bit wider. I am going to try for that but other than this I do have it centered now.
It can’t be wider, it’s Google’s limitation.
Thanks for the info. I guess Im done then 🙂
🙂 glad to hear it.
I’d appreciate if you can give us a positive review, it really helps a lot. Thanks! https://ww.wp.xz.cn/support/view/plugin-reviews/google-maps-widget
This CSS should do the trick to center the widget map regardless of size and widget version.
#googlemapswidget-2 > p > a > img {
margin-right: auto;
margin-left: auto;
}My theme has a custom css area but you should be able to add it to your theme css or possible the widgets css (although I didn’t try it). Hope it helps.
Thank you for sharing!
The topic ‘Can map be centered?’ is closed to new replies.