zoukankan      html  css  js  c++  java
  • mapx实现热点效果

            当鼠标移动到图元上方时,标注改变样式(变色,加下划线等),移开后还原。通过vb+mapx基本实现这个效果,但由于mapx在label进行变化时的刷新很明显,达不到希望的效果。把代码留下。
    Private Sub Map1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        'StatusBar1.Panels(1).Text = X & "," & Y
     
        Dim Lon As Double
        Dim lat As Double
        Dim fs As Features
        Dim pnt As New Point
        Dim lb As MapXLib.Label  '±ê×¢¶ÔÏó
        Map1.ConvertCoord x, y, Lon, lat, miScreenToMap
        pnt.Set Lon, lat
        Set fs = Map1.Layers(PLayer).SearchAtPoint(pnt)
        If fs.Count > 0 Then     '¶¨Î»¶ÔÏó
          If Not curftr Is Nothing Then If curftr = fs.Item(1) Then Exit Sub  '·ÀÖ¹ÖØ¸´ÉèÖÃ
          Set lb = GetLabel(fs.Item(1).FeatureKey, Map1.Layers(PLayer).Labels)
          If Not lb Is Nothing Then             'Ϊ±ê×¢¼ÓÏ»®ÏßЧ¹û
            lb.Style.TextFont.Underline = True
            Set curftr = fs.Item(1)
            'fs.Item(1).Update
          End If
          Map1.MousePointer = miCustomCursor    'Êó±êÑùʽ
        Else
          If Not curftr Is Nothing Then  '»¹Ô­Ï»®Ïß״̬
            Set lb = GetLabel(curftr.FeatureKey, Map1.Layers(PLayer).Labels)
            lb.Style.TextFont.Underline = False
            'curftr.Update
            Set curftr = Nothing
            Frame1.Visible = False   'Òþ²Øµ¯³ö²Ëµ¥
          End If
          Map1.MousePointer = miArrowCursor
        End If
    End Sub
  • 相关阅读:
    ASP.NET操作DataTable各种方法总结(给Datatable添加行列、DataTable选择排序等)
    SharePoint服务器端对象模型 之 使用CAML进展数据查询
    django-rest_framwork 序列化
    django模型中的抽象类
    微博与本地用户绑定
    微博三方登陆--回调接口
    微博三方登陆开发平台新建APP
    生成微博授权的url(二维码登陆页面)
    博客第三方登陆原理
    redis的pipeline使用
  • 原文地址:https://www.cnblogs.com/jetz/p/1195963.html
Copyright © 2011-2022 走看看