我一直试图让谷歌地图在我的sencha触摸页面上工作,但它不起作用。 我已经找到了很多关于这个问题的主题,但我似乎无法在我的代码中找到问题。基本上目前我正试图用谷歌地图在我当前的位置上放置一个标记。稍后我会尝试根据给定的地址显示路线。但是当我打开页面时,我只看到地图的界面元素。它在我的元素检查器中用chrome表示以下内容:
Uncaught RangeError: Maximum call stack size exceeded
ze
F.get
F.get
(anonymous function)
F.transform_changed
ag
ag
F.set
Rs.(anonymous function).ta
F.aa
Qh.(anonymous function).l
(anonymous function)
O.trigger
F.aa
Qh.(anonymous function).l
(anonymous function)
O.trigger
F.aa
Qh.(anonymous function).l
(anonymous function)
O.trigger
我刚注意到我在元素检查器中也收到了以下消息:
Resource interpreted as Font but transferred with MIME type font/woff: "http://themes.googleusercontent.com/static/fonts/roboto/v9/Hgo13k-tfSpn0qi1SFdUfT8E0i7KZn-EPnyo3HZu7kw.woff".
Resource interpreted as Font but transferred with MIME type font/woff: "http://themes.googleusercontent.com/static/fonts/roboto/v9/2UX7WLTfW3W8TclTUvlFyQ.woff".
Resource interpreted as Font but transferred with MIME type font/woff: "http://themes.googleusercontent.com/static/fonts/roboto/v9/RxZJdnzeo3R5zSexge8UUT8E0i7KZn-EPnyo3HZu7kw.woff".
我视图中的代码如下:
Ext.define('Sencha.view.Tournaments', {
extend: 'Ext.Container',
xtype: 'tournamentPage',
config: {
title: 'maps',
layout: 'fit'
},
initialize : function() {
var lat, lng;
var geoLocationOptions = {
maximumAge: 3000,
timeout: 5000,
enableHighAccuracy: true
};
navigator.geolocation.getCurrentPosition(geoLocationSuccess,geoLocationError,geoLocationOptions);
function geoLocationSuccess(position) {
lat = position.coords.latitude;
lng = position.coords.longitude;
}
function geoLocationError() {
Ext.Msg.alert('Error','Error while getting geolocation');
}
var position = new google.maps.LatLng(lat,lng);
map = this.add({
xtype: 'map',
getLocation: true,
autoLoad: true,
mapOptions: {
zoom: 15,
center: position,
mapTypeId: google.maps.MapTypeId.ROADMAP,
navigationControl: true,
zoomControl: true,
mapTypeControl: true,
scrollwheel: true,
scaleControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE
}
}
});
marker = new google.maps.Marker({
id: 'geoLocMarker',
position: position,
map: map.getMap(),
visible: true
});
}
})
我希望我不是要问一个愚蠢的问题,我正在努力学习!我已经有一段时间了,它似乎不起作用!提前谢谢。