Ruby on rails gmaps4rails在刷新时检测位置跳转
我在Rails 3.1.3应用程序中使用gmaps4rails,我在gmaps4rails.base.js.coffee文件中设置了位置检测,如下所示Ruby on rails gmaps4rails在刷新时检测位置跳转,ruby-on-rails,ruby-on-rails-3,geolocation,gmaps4rails,Ruby On Rails,Ruby On Rails 3,Geolocation,Gmaps4rails,我在Rails 3.1.3应用程序中使用gmaps4rails,我在gmaps4rails.base.js.coffee文件中设置了位置检测,如下所示 @default_map_options = id: 'map' draggable: true detect_location: true # should the browser attempt to use geolocation detection features of HTML5? center_on_user: t
@default_map_options =
id: 'map'
draggable: true
detect_location: true # should the browser attempt to use geolocation detection features of HTML5?
center_on_user: true # centers map on the location detected through the browser
center_latitude: 0
center_longitude: 0
zoom: 7
maxZoom: null
minZoom: 10
auto_adjust : true # adjust the map to the markers if set to true
auto_zoom: true # zoom given by auto-adjust
bounds: [] # adjust map to these limits. Should be [{"lat": , "lng": }]
raw: {} # raw json to pass additional options
这种方法有一半的时间有效。我注意到,当我按F5或Ctrl+r刷新浏览器时,它有时会将我置于Broken Hill,而我本应在墨尔本(相差840公里)
有时我看到它很快就去了破山,然后在装货的时候切换到墨尔本。以下是我安装的所有其他插件:
#= require gmaps4rails/gmaps4rails.base
#= require gmaps4rails/gmaps4rails.googlemaps
#= require jquery
#= require jquery_ujs
#= require jquery.ui.datepicker
#= require jquery-ui-timepicker-addon
#= require jquery.ui.autocomplete
#= require jquery.ui.slider
#= require jquery.flexslider
#= require jquery.ui.widget
#= require jquery.ui.mouse
#= require jquery.ui.touch-punch.min
#= require jQuery.BlackAndWhite
#= require form-accordion
#= require modernizr
#= require lovesjavascript
#= require jquery.tokeninput
#= require authentications
#= require inquiries
#= require registrations
#= require search
#= require tinymce-jquery
#= require jquery.sticky
#= require_self
我只尝试过gmaps4rails base和Google地图,但仍然存在问题。我使用标准的html5地理定位。这有时会失败。酷,我还以为只有我。