Gmaps.store.handler.getMap().zoomTo(10)
私にくれますUncaught TypeError: Object #<pi> has no method 'zoomTo'
そのすぐ上で、緯度と経度を指定して Gmaps.store.handler.map.centerOn を呼び出します。適切に中央に配置されるので、ハンドラーが正しいと信じる傾向があります。私はハンドラを呼び出します
Gmaps.store = {} #handler, markers, userPin, eventPin
jQuery ->
Gmaps.store.handler = Gmaps.build 'Google'
Gmaps.store.handler.buildMap { internal: {id: 'map'} }, ->
Gmaps.store.markers = Gmaps.store.handler.addMarkers( $('#map').data('events'),
draggable: false
flat: false
animation: google.maps.Animation.DROP
)
google.maps.event.addListener Gmaps.store.handler.getMap(), 'click', (event) ->
addEventMarker event.latLng if $('#createEventWindow').is(':visible')
また、 を呼び出すと、180 と 1 が返されます。境界でもGmaps.store.handler.bounds
呼び出すことができるのではないでしょうか? .getNorthEast()
コンソールは、そのような機能がないことを教えてくれます。野獣の写真はこちら…
アップデート
updateSearchLocation = ->
if $('#collapseOne input#location').val()
geocoder = new google.maps.Geocoder()
address = $('#collapseOne input#location').val()
geocoder.geocode address: address, (results, status) ->
if status is google.maps.GeocoderStatus.OK
latLng = results[0].geometry.location
Gmaps.store.handler.map.centerOn
lat: latLng.lat()
lng: latLng.lng()
Gmaps.store.handler.getMap().setZoom(10)
console.log Gmaps.store.handler.bounds.getServiceObject().getNorthEast()
$('#collapseOne input#ne').val Gmaps.store.handler.bounds.getServiceObject().getNorthEast()
$('#collapseOne input#sw').val Gmaps.store.handler.bounds.getServiceObject().getSouthWest()
else
throw status + ' for ' + address