0

I have some small maps on my page that i show markers with marker clusters.

I really don't want any zoom or other tools displayed on this map. Partly because the tools don't even display correctly (no matter the size of the canvas).

I am using gmaps4rails Gem

here is a picture of what i have now:

enter image description here

I want to remove what i have blocked in red:

enter image description here

Here is my coding:

<div style='padding: 6px;
        border-width: 1px;
        border-style: solid;
        border-color: #ccc #ccc #999 #ccc;
        -webkit-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
        -moz-box-shadow: rgba(64, 64, 64, 0.5) 0 2px 5px;
        box-shadow: rgba(64, 64, 64, 0.1) 0 2px 5px;
'>
  <div id="map2" style='width: 450px; height: 200px;'></div>
</div>

<script type="text/javascript">
    handler2 = Gmaps.build('Google', { markers: { clusterer: {gridSize: 50, maxZoom: 5} } });
    handler2.buildMap({ provider: {}, internal: {id: 'map2'}}, function(){
        handler2.addMarkers(<%=raw @hash2.to_json %>);
        handler2.getMap().setZoom(3);
        handler2.map.centerOn([39.828127,-98.579404]);
    });
</script>
1

1 Answer 1

2

According to google maps doc, you can do it with disableDefaultUI.

So pass it in provider object:

provider: {disableDefaultUI: true }

See plunkr

1
  • Thank you tremediously... i had saw the disableDefaultUI: true but was not sure how to implement it into the coding i had... i kept seeing it in mapOptions = {} I guess that mapOptions can go in the provider: {} section. Commented Oct 29, 2014 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.