如何在Google地图中添加标记? [英] How Do I Add Marker In Google Map ?

查看:175
本文介绍了如何在Google地图中添加标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<script type="text/javascript">
        $(function () {
            $("#btnShow").click(function () {
                var geoLocation = document.getElementById('geoLocation123').value;
                temp = geoLocation.split(",");
                //alert(temp[0]);
                //alert(temp[1]);
                //alert(geoLocation);
                $("#dialog").dialog({
                    modal: true,
                    title: "Google Map",
                    width: 600,
                    height: 450,
                    buttons: {
                        Close: function () {
                            $(this).dialog('close');
                        }
                    },
                    open: function () {
                        var mapOptions = {
                            center: new google.maps.LatLng(temp[0], temp[1]),
                            zoom: 10,
                            mapTypeId: google.maps.MapTypeId.ROADMAP
                        }
                        var map = new google.maps.Map($("#dvMap")[0], mapOptions);
                    }
                });
            });
        });
    </script>

推荐答案

function ( ){


#btnShow)。点击( function (){
var geoLocation = document .getElementById(' geoLocation123')。value;
temp = geoLocation。 split( );
/ / alert(temp [0]);
// alert(temp [1]);
// alert (geoLocation);
("#btnShow").click(function () { var geoLocation = document.getElementById('geoLocation123').value; temp = geoLocation.split(","); //alert(temp[0]); //alert(temp[1]); //alert(geoLocation);


#dialog)。dialog({
modal: true
title: Google Map
width: 600
height: 450
按钮:{
关闭:功能(){
("#dialog").dialog({ modal: true, title: "Google Map", width: 600, height: 450, buttons: { Close: function () {


这篇关于如何在Google地图中添加标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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