使用jquery的此Google Map有什么问题 [英] what's the problem with this Google Map using jquery

查看:145
本文介绍了使用jquery的此Google Map有什么问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net页面中使用此代码.但是浏览器(ff& ie8)不会显示地图.为什么?

hi.I use this code inside an asp.net page. but browser (ff & ie8)don''t show map. why?

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="MapMaker/js/mapmarker.jquery.js"></script>
    <script type="text/javascript">// <![CDATA[
        $(document).ready(function () {

            //set up markers
            var myMarkers = {
                "markers": [
                { "latitude": "35.741967910829295", "longitude": "51.54246568548842", "icon": "img/house.png", "baloon_text": 'This is Texas' }
                ]
            };

            //set up map options
            $("#map").mapmarker({
                zoom: 5,
                center: 'United States',
                markers: myMarkers
            });

        });
        // </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div id="map" style="width: 550px; height: 450px; border: 2px solid red;"></div>

</asp:Content>



ContentPlaceHolder1被"Head"标记包围.
我使用了这个来源:
http://www.welancers.com/jquery-map-marker-plugin/ [ ^ ]



ContentPlaceHolder1 is surrounded by "Head" tag.
I used this source:
http://www.welancers.com/jquery-map-marker-plugin/[^]

推荐答案

(document).ready(function(){ // 设置标记 var myMarkers = { " :[ {" :" 35.741967910829295" 经度":" " : img/house.png"" :' // 设置地图选项
(document).ready(function () { //set up markers var myMarkers = { "markers": [ { "latitude": "35.741967910829295", "longitude": "51.54246568548842", "icon": "img/house.png", "baloon_text": 'This is Texas' } ] }; //set up map options


(" ).mapmarker({ 缩放: 5 , 中心:' 美国', 标记:myMarkers }); }); // </script> </ asp:Content > < asp:Content ID = " ContentPlaceHolderID = " runat = " > < div id = " style = " 宽度:550px;高度:450px;边框:2px实心红色;" </ div > </ asp:Content >
("#map").mapmarker({ zoom: 5, center: 'United States', markers: myMarkers }); }); // </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server"> <div id="map" style="width: 550px; height: 450px; border: 2px solid red;"></div> </asp:Content>



ContentPlaceHolder1被"Head"标记包围.
我使用了这个来源:
http://www.welancers.com/jquery-map-marker-plugin/ [ ^ ]



ContentPlaceHolder1 is surrounded by "Head" tag.
I used this source:
http://www.welancers.com/jquery-map-marker-plugin/[^]


查看我的文章的设置场景部分: D3.js崩溃过程-第2部分 [^ ]

我的猜测是,您要加载jQuery两次-很有可能是jQuery的两个不同版本-这往往会使事情的行为无法预测.

最好的问候
Espen Harlinn
Have a look at the Setting the Scene part of my article: D3.js crash course - Part2[^]

My guess is that you''re loading jQuery twice - and most likely two different versions of jQuery - which tends to make things behave unpredictably.

Best regards
Espen Harlinn


这篇关于使用jquery的此Google Map有什么问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆