输入“Artem.Google.UI.GoogleMap”没有名为“GoogleMarkers”的公共属性

时间:2014-08-02 21:33:06

标签: asp.net google-maps

我正在使用Visual Studio 2012

在ASP.NET和谷歌地图的网站上工作

我正在尝试使用此代码在地图上添加标记

    <artem:GoogleMap id="GoogleMap1" runat="server" BackColor="White" Width="100%" Height="500px" Key="here I am using my key" 
    Latitude="33.512808" Longitude="36.292219" Zoom="13" EnableZoomControl="true" EnablePanControl="true" EnableScrollWheelZoom="false">

         <artem:GoogleMarkers runat="server" Latitude="33.512808" Longitude="36.292219">

         </artem:GoogleMarkers>

    </artem:GoogleMap>

但它给了我两个错误

 Error  19  Type 'Artem.Google.UI.GoogleMap' does not have a public property named 'GoogleMarkers'.
 Error  20  Content ('</artem:GoogleMarkers>') does not match any properties within a 'Artem.Google.UI.GoogleMap', make sure it is well-formed.

我在web.config中有这个代码

    <pages>
        <controls>
            <add tagPrefix="artem" namespace="Artem.Google.UI" assembly="Artem.Google" />
        </controls>
    </pages>

1 个答案:

答案 0 :(得分:0)

您可以在后面的代码中添加标记:

Dim objMarker As New Artem.Google.UI.Marker()
'objMarker.Icon.Url = "/images/marker.png"
objMarker.Position.Longitude = Longitude
objMarker.Position.Latitude = Latitude
objMarker.Info = "some html description"
Googlemap1.Markers.Add(objMarker)