Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/85.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.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
Jquery 可以以及如何使用query mobile和google maps导入标记和弹出窗口_Jquery_Json_Mobile_Maps - Fatal编程技术网

Jquery 可以以及如何使用query mobile和google maps导入标记和弹出窗口

Jquery 可以以及如何使用query mobile和google maps导入标记和弹出窗口,jquery,json,mobile,maps,Jquery,Json,Mobile,Maps,我在创建弹出窗口时遇到了一些问题。我可以让制作人展示,但似乎无法让弹出窗口与标记一起工作 欢迎对此提供任何帮助: <script type="text/javascript"> function loadMap() { SyntaxHighlighter.all(); $('#map_canvas').gmap({ 'center':new google.maps.LatLng(cc_maps_lat, cc_maps_l

我在创建弹出窗口时遇到了一些问题。我可以让制作人展示,但似乎无法让弹出窗口与标记一起工作

欢迎对此提供任何帮助:

<script type="text/javascript">
    function loadMap() {
        SyntaxHighlighter.all();
        $('#map_canvas').gmap({ 
          'center':new google.maps.LatLng(cc_maps_lat, cc_maps_long),
          'zoom':cc_maps_zoom, 
          'streetViewControl': cc_streetView,
          'mapTypeControl' : true, 
          'navigationControl' : true,

          'callback': function() {
            $.getJSON( '_config/pips.json', 'category=activity', function(data) { 
                $.each( data.markers, function(i, m) {
                    $('#map_canvas').gmap('addMarker', { 'position': new google.maps.LatLng(m.lat, m.lng) } );
                });
            });
          }

        });
    }
</script>

<div id="gmap" data-role="page">
    <div data-role="header" data-position="inline">
        <h1>Maps</h1>
        <a href="#home" data-icon="home" class="ui-btn-right" data-iconpos="notext" data-transition="slidedown">Home</a>
    </div>
    <div data-role="content"> 
        <div id="map_canvas" style="height:440px;"></div>
        <!-- <div id="map_canvas" style="height:440px;"></div> -->
    </div>
</div>

请注意附加的click函数,它将放在$中。每个函数

$('#map_canvas').gmap('addMarker', {
'position': new google.maps.LatLng(marker.Lat, marker.Lng), 
'bounds': true
}).click(function() {
$('#map_canvas').gmap('openInfoWindow', { 'content': marker.City }, this);
});
然后将marker.City修改为所需的JSON提要项

$('#map_canvas').gmap('addMarker', {
'position': new google.maps.LatLng(marker.Lat, marker.Lng), 
'bounds': true
}).click(function() {
$('#map_canvas').gmap('openInfoWindow', { 'content': marker.City }, this);
});