【问题标题】:Getting Subgurim Map Marker Position in Button Click Event在按钮单击事件中获取 Subgurim 地图标记位置
【发布时间】:2013-10-19 11:52:30
【问题描述】:

我正在使用 Subgurim Map 根据输入的地址设置标记。使用 GMarker,我可以将其加载到地图中。

现在这个地址可能是错误的或在附近的实际地址。这样我就有机会让客户使用不同的标记设置实际地址(当一个名为“Pick Bubble”按钮的按钮时会冒泡)

喜欢,

StringBuilder sb = new StringBuilder();
        sb.Append(txtAddress.Text.Trim());
        sb.AppendFormat(", {0}", txtCity.Text.Trim());
        sb.AppendFormat("- {0}", txtZipcode.Text.Trim());
        sb.Append(", Gujarat");
        sb.AppendFormat(", {0}", txtCountry.Text.Trim());

        GetAddressCordinates googleCordinate = new GetAddressCordinates(Constants.APP_SETTINGS.GoogleMapAPIKey);
        Coordinate cordinate = googleCordinate.GetCoordinates(sb.ToString());

        GLatLng gLatLng = new GLatLng();
        {
            gLatLng.lat = double.Parse(cordinate.Latitude.ToString());
            gLatLng.lng = double.Parse(cordinate.Longitude.ToString());
        }

        if (gLatLng != null)
        {
            GMarker gMarker;

            GIcon gIcon = new GIcon();
            gIcon.image = ResolveUrl(string.Format("~/Images/ActualFlag.png"));
            gIcon.shadow = ResolveUrl(string.Format("~/Images/Shadow.png"));
            gIcon.shadowSize = new GSize(30, 30);
            gIcon.iconSize = new GSize(24, 24);

            GMarkerOptions mOpts = new GMarkerOptions();
            mOpts.draggable = true;
            mOpts.RaiseOnDrag = true;
            mOpts.Animation = GMarkerOptions.AnimationType.Bounce;
            mOpts.icon = gIcon;

            gMarker = new GMarker(gLatLng, mOpts);

            GInfoWindow infoWindow = new GInfoWindow(gMarker, "", false);

            GMap1.addInfoWindow(infoWindow);
            //GMap1.addGMarker(gMarker);

            string jsFunction = string.Format("function(){{ var ev = new serverEvent('dragend', 0); ev.addArg({0}.getPoint().lat()); ev.addArg({0}.getPoint().lng()); ev.send(); }}", gMarker.ID);

            GListener listener = new GListener(gMarker.ID, GListener.Event.dragend, "alertame");
            GMap1.Add(listener);
            GMap1.setCenter(gLatLng);
        }

现在我想将这两个标记位置放入名为“NEXT”的按钮中进行操作。

我将如何获得标记位置?

【问题讨论】:

    标签: asp.net google-maps c#-3.0 subgurim-maps


    【解决方案1】:

    您是否尝试将其放入 GinfoWindow ? 作为字符串如下:

     dir= "<input type='button' name='next'>"
    

    进入:

     GInfoWindow infoWindow = new GInfoWindow(gMarker, dir, false);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-07
      • 2016-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-15
      相关资源
      最近更新 更多