Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google maps jquerymobile不';不要跟随来自另一个JQM页面的链接_Google Maps_Jquery Mobile_Jquery Ui Map - Fatal编程技术网

Google maps jquerymobile不';不要跟随来自另一个JQM页面的链接

Google maps jquerymobile不';不要跟随来自另一个JQM页面的链接,google-maps,jquery-mobile,jquery-ui-map,Google Maps,Jquery Mobile,Jquery Ui Map,我正在使用jQueryUIMap插件,当我单击按钮时,我的测试页面(test.html)会正确加载Google地图。如果用户从另一个jquery移动页面加载test.html,则该test.html不起作用。我做了什么坏事还是错过了什么?接下来是重要代码: 标头中的Javascript(如基本映射示例中所示): 还有html(很抱歉,我无法发布html代码,因为它已被解释,但链接如下): 正如我所说的,如果我直接在浏览器中编写test.html,这将非常有效,但如果来自另一个页面: 它只是忽

我正在使用jQueryUIMap插件,当我单击按钮时,我的测试页面(test.html)会正确加载Google地图。如果用户从另一个jquery移动页面加载test.html,则该test.html不起作用。我做了什么坏事还是错过了什么?接下来是重要代码:

标头中的Javascript(如基本映射示例中所示):

还有html(很抱歉,我无法发布html代码,因为它已被解释,但链接如下):

正如我所说的,如果我直接在浏览器中编写test.html,这将非常有效,但如果来自另一个页面:


它只是忽略“单击”或触摸按钮以显示地图。提前感谢您的帮助。

我在您的代码中看到的一个问题是如何使用
live
。建议将
live
替换为
on

var mobileDemo = { 'center': '57.7973333,12.0502107', 'zoom': 10 };
$('#basic_map').live('pageinit', function() {
  demo.add('basic_map', function() {
    $('#map_canvas').gmap({
      'center': mobileDemo.center, 
      'zoom': mobileDemo.zoom,
      'disableDefaultUI':true,
      'callback': function() {
    var self = this;
    self.addMarker({'position': this.get('map').getCenter() }).click(function() {
      self.openInfoWindow({ 'content': 'Hello World!' }, this);
      });
    }});
  }).load('basic_map');
});

$('#basic_map').live('pageshow', function() {
  demo.add('basic_map', function() { $('#map_canvas').gmap('refresh'); }).load('basic_map');
});