Any suggestions on the unique Zoom Button design in Google Map?

I have integrated the Google Maps JS API into a WordPress website and added a map to the contact page template. However, I am experiencing some strange behavior where the Zoom In and Zoom Out button style is not displaying as + and -. Does anyone have any suggestions on how to get the default buttons back? Check out the Google Map Codes on JS Fiddle

var map;
function initialize() {

var mapOptions = {
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
zoom: <?php echo $map_zoom;?>,
zoomControl: true,
scrollwheel: false,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.DEFAULT,
position: google.maps.ControlPosition.DEFAULT
},
panControl: false,
streetViewControl: false,
scaleControl: false,
overviewMapControl: false,
center: new google.maps.LatLng(<?php echo $contact_info['map']['lat'];?>,<?php echo $contact_info['map']['lng'];?>)
};

map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);

var infoContent = 'Your content goes here';

var infowindow = new google.maps.InfoWindow({
content: infoContent
});

var icon = {
path: 'Your icon path here',
anchor: new google.maps.Point(16.5, 51),
fillColor: '<?php echo $map_marker_colour;?>',
fillOpacity: 0.6,
strokeWeight: 0,
scale: 1
};

var marker = new google.maps.Marker({
position: new google.maps.LatLng(<?php echo $contact_info['map']['lat'];?>,<?php echo $contact_info['map']['lng'];?>),
map: map,
icon: icon,
title: 'marker'
});

google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}

google.maps.event.addDomListener(window, 'load', initialize);

Take a look at the Screenshot Here

Answer №1

When creating your own style, ensure that you do not allow any img styles to override the google map img style. The default setting is

.gm-style img{ max-width: none; }
If you need to use !important on certain img tags, You can use:
.gm-style img{ max-width: none !important; }
to remedy this issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to horizontally center a div while ensuring the content within the div stays aligned?

I'm attempting to align a div in the center while maintaining the position of its contents. Check out my code snippet: <style> .wrap{ position: relative; } .character{ position: absolute; bottom: -10%; left: 0; heigh ...

What is the proper way to arrange CSS classes in a specific order?

I am facing some confusion regarding the CSS and the class attribute. I had always believed that the order in which multiple classes are specified within the attribute value holds significance. It was my understanding that the later class could or should o ...

Adjust the size of the text and the textarea at the same time

I am trying to resize text simultaneously while resizing the textarea in my code. I am using jQuery for this functionality. However, I believe there is an issue with the click function being separated. Any advice on how to fix this would be greatly appreci ...

Dynamic kid-friendly template and interactive scripting

I'm currently facing an issue with customizing a responsive theme in Wordpress called Childify, which I obtained from . You can access the website at by overriding the hosts file with the following IP: 213.186.33.4 www.mas-seraphin.com Below ...

What could be causing the JavaScript on my website to not function properly?

I've encountered an issue with the script on my website. Despite double-checking everything and following a tutorial closely, it still doesn't seem to work. Any suggestions or ideas? Here are the links to my GitHub repository and a preview of th ...

Iterating through objects in an array using JavaScript should only happen after the current object

As an illustration: Starting from [x0,x1,x2,x3] - x0 compares itself to x1,x2 and x3. x1 compares itself to x0, x2 and x3. And so forth... To [x0,x1,x2,x3] - x0 compares itself to x1,x2 and x3. x1 compares itself to x2 and x3 only. x2 only compares ...

Capitalizing a specific letter in a string at a designated index

Looking for an efficient way to convert a specific letter in a string to uppercase? Let's explore different methods: Suppose we have the string: let str = "Dwightschrute"; One way to achieve this is by slicing the string and then updating the desir ...

When attempting to use tunnel-ssh, the error message "TypeError: Object is not a function" is displayed

Currently, I am testing out the introductory example provided in a tutorial for the widely used NPM package called tunnel-ssh. Below is the code snippet that I have been executing: var tunnel = require('tunnel-ssh'); var config = { username: ...

"Enhancing user experience through file uploads using the onchange event

I'm currently working on implementing file upload functionality using the onchange event. I encountered an error stating that 'file is not defined.' //html file <input type="file" style="display: none;" onchange="angular.element(th ...

Numerous Kendo windows are layered on top of each other, yet the text divisions within them remain distinct

I am currently working on a project that involves laying out multiple Kendo windows in rows. Specifically, I need to display 4 windows in each row and have them shift left when closed. My framework of choice is Bootstrap 3. Everything works as expected w ...

How do I automatically redirect to a different URL after verifying that the user has entered certain words using Javascript?

I want to create a function where if a user input on the "comments" id matches any word in my FilterWord's array, they will be redirected to one URL. If the input does not match, they will be redirected to another URL. The checking process should onl ...

Guarantee of SQL integration within JavaScript

I am trying to retrieve the value of the message variable, but all I see in the console is the following: result [object Promise] async function Testing() { let response = await new Promise((resolve, reject) => { db.query("SELECT * FROM `ni ...

Is there a way to interact with a DOM element through clicking and then pass it as a variable using PHP?

Is there a way to configure a table so that data from a specific row is sent to a PHP script and displayed in a section on the website when the user clicks on that row? I am looking to pre-fill a data entry form with information from a selected row, allow ...

Tips for rearranging elements with bootstrap 4:

In my project, I have a section where I am trying to display nested elements using bootstrap for a more organized layout. Here is the current HTML code: <div class="container"> <div class="row d-flex d-lg-block"> <div class="c ...

How about a custom-designed talking JavaScript pop-up?

Looking to customize the appearance (CSS, buttons...) of a "confirm" JavaScript dialog box while ensuring it remains persistent. The dialog box appears after a countdown, so it is crucial that it maintains focus even if the user is on another browser tab o ...

Tips for deactivating data monitoring in a Vue.js component attribute

Looking to develop a Vue.js component that accepts properties from its parent component, like this example: <table-cell :value="foo" format="date" /> Although value and format are set as properties, Vue automatically sets up obse ...

Refusing to include two values due to the presence of a comma in JavaScript

I'm trying to add two values with commas and .00 (Example: 1,200.23 + 2,500.44) but it's not working because the textbox includes commas as required by my system. The result shows NaN because the comma is considered a special character. It was w ...

The requested resource does not have the 'Access-Control-Allow-Origin' header in nginx

Although I have come across many similar questions, none of them have helped me solve my specific problem. jQuery.post( 'http://example.com/api_offer/get_time_left', function(data) { console.log('get time'); }, 'json'); ...

Embed Text inside an HTML Canvas

As someone who is relatively new to working with html canvas, I am having a bit of trouble when it comes to containing text within the canvas area. Specifically, I am pulling text from a textarea and displaying it on the canvas, but it seems to stay as one ...

Data in DynamoDB Local is deleted once the instance is shut down

My app is utilizing DynamoDB Local and I am facing an issue where it keeps deleting all the sample data each time I shut down the instance. This problem seems to be unique as I have not found any similar cases while searching for a solution. I typically ...