title: InfoWindow shouldFocus in Jquery not working
body: <p>Where and how should I add <code>InfoWindow.open({anchor: marker, shouldFocus: false});</code> so that the browser doesn't focus on the Google Map embedded on the web page?</p>
  <p>I have seen plenty of examples in plain JS, but I can't get any of them to work with this existing jquery code.</p>
  <p>I keep trying, but cannot figure it out.</p>
  <pre><code>    ! function(e) {
      e.fn.gMap = function(o, a) {
          switch (o) {
              case &quot;addMarker&quot;:
                  return e(this).trigger(&quot;gMap.addMarker&quot;, [a.latitude, a.longitude, a.content, a.icon, a.popup]);
              case &quot;centerAt&quot;:
                  return e(this).trigger(&quot;gMap.centerAt&quot;, [a.latitude, a.longitude, a.zoom]);
              case &quot;clearMarkers&quot;:
                  return e(this).trigger(&quot;gMap.clearMarkers&quot;)
          }
          var n = e.extend({}, e.fn.gMap.defaults, o);
          return this.each(function() {
              var o = new google.maps.Map(this);
              e(this).data(&quot;gMap.reference&quot;, o);
              var a = new google.maps.Geocoder;
              n.address ? a.geocode({
                  address: n.address
              }, function(e) {
                  e &amp;&amp; e.length &amp;&amp; o.setCenter(e[0].geometry.location)
              }) : n.latitude &amp;&amp; n.longitude ? o.setCenter(new google.maps.LatLng(n.latitude, n.longitude)) : e.isArray(n.markers) &amp;&amp; n.markers.length &gt; 0 ? n.markers[0].address ? a.geocode({
                  address: n.markers[0].address
              }, function(e) {
                  e &amp;&amp; e.length &gt; 0 &amp;&amp; o.setCenter(e[0].geometry.location)
              }) : o.setCenter(new google.maps.LatLng(n.markers[0].latitude, n.markers[0].longitude)) : o.setCenter(new google.maps.LatLng(34.885931, 9.84375)), o.setZoom(n.zoom), o.setMapTypeId(google.maps.MapTypeId[n.maptype]);
              var s = {
                  scrollwheel: n.scrollwheel,
                  disableDoubleClickZoom: !n.doubleclickzoom
              };
              n.controls === !1 ? e.extend(s, {
                  disableDefaultUI: !0
              }) : 0 !== n.controls.length &amp;&amp; e.extend(s, n.controls, {
                  disableDefaultUI: !0
              }), o.setOptions(s), o.setOptions({
                  styles: n.styles
              });
              var t, r, i = new google.maps.Marker;
              t = new google.maps.MarkerImage(n.icon.image), t.size = new google.maps.Size(n.icon.iconsize[0], n.icon.iconsize[1]), t.anchor = new google.maps.Point(n.icon.iconanchor[0], n.icon.iconanchor[1]), i.setIcon(t), n.icon.shadow &amp;&amp; (r = new google.maps.MarkerImage(n.icon.shadow), r.size = new google.maps.Size(n.icon.shadowsize[0], n.icon.shadowsize[1]), r.anchor = new google.maps.Point(n.icon.shadowanchor[0], n.icon.shadowanchor[1]), i.setShadow(r)), e(this).bind(&quot;gMap.centerAt&quot;, function(e, a, n, s) {
                  s &amp;&amp; o.setZoom(s), o.panTo(new google.maps.LatLng(parseFloat(a), parseFloat(n)))
              });
              var g = [];
              e(this).bind(&quot;gMap.clearMarkers&quot;, function() {
                  for (; g[0];) g.pop().setMap(null)
              });
              var l;
              e(this).bind(&quot;gMap.addMarker&quot;, function(e, a, s, t, r, d) {
                  var c, p, m = new google.maps.LatLng(parseFloat(a), parseFloat(s)),
                      h = new google.maps.Marker({
                          position: m
                      });
                  if (r ? (c = new google.maps.MarkerImage(r.image), c.size = new google.maps.Size(r.iconsize[0], r.iconsize[1]), c.anchor = new google.maps.Point(r.iconanchor[0], r.iconanchor[1]), h.setIcon(c), r.shadow &amp;&amp; (p = new google.maps.MarkerImage(r.shadow), p.size = new google.maps.Size(r.shadowsize[0], r.shadowsize[1]), p.anchor = new google.maps.Point(r.shadowanchor[0], r.shadowanchor[1]), i.setShadow(p))) : (h.setIcon(i.getIcon()), h.setShadow(i.getShadow())), t) {
                      &quot;_latlng&quot; === t &amp;&amp; (t = a + &quot;, &quot; + s);
                      var w = new google.maps.InfoWindow({
                          content: n.html_prepend + t + n.html_append
                      });
  
                      google.maps.event.addListener(h, &quot;click&quot;, function() {
                          l &amp;&amp; l.close(), w.open(o, h), l = w
                      }), d &amp;&amp; google.maps.event.addListenerOnce(o, &quot;tilesloaded&quot;, function() {
                          w.open(o, h)
                      })
                  }
                  h.setMap(o), g.push(h)
              });
              for (var d, c = this, p = function(o) {
                      return function(a) {
                          a &amp;&amp; a.length &gt; 0 &amp;&amp; e(c).trigger(&quot;gMap.addMarker&quot;, [a[0].geometry.location.lat(), a[0].geometry.location.lng(), o.html, o.icon, o.popup])
                      }
                  }, m = 0; m &lt; n.markers.length; m++) d = n.markers[m], d.address ? (&quot;_address&quot; === d.html &amp;&amp; (d.html = d.address), a.geocode({
                  address: d.address
              }, p(d))) : e(this).trigger(&quot;gMap.addMarker&quot;, [d.latitude, d.longitude, d.html, d.icon, d.popup])
          })
      }, e.fn.gMap.defaults = {
          address: &quot;&quot;,
          latitude: 0,
          longitude: 0,
          zoom: 1,
          markers: [],
          controls: [],
          styles: [],
          scrollwheel: !1,
          doubleclickzoom: !0,
          maptype: &quot;ROADMAP&quot;,
          html_prepend: '&lt;div class=&quot;gmap_marker&quot;&gt;',
          html_append: &quot;&lt;/div&gt;&quot;,
          icon: {
              image: &quot;https://www.google.com/mapfiles/marker.png&quot;,
              shadow: &quot;https://www.google.com/mapfiles/shadow50.png&quot;,
              iconsize: [20, 34],
              shadowsize: [37, 34],
              iconanchor: [9, 34],
              shadowanchor: [6, 34]
          }
      }
  }(jQuery);
  </code></pre>