[GB.MAP]
* OPT: Rename MTile in Geo git-svn-id: svn://localhost/gambas/trunk@5371 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
18fb03e718
commit
2902e63546
8 changed files with 41 additions and 11 deletions
|
@ -1,3 +1,32 @@
|
|||
#Geo
|
||||
|
||||
C
|
||||
MapPointToTile
|
||||
M
|
||||
Point
|
||||
(hMapPoint)MapPoint;(Zoom)i
|
||||
MapPointToPixel
|
||||
M
|
||||
Point
|
||||
(hMapPoint)MapPoint;(Zoom)i
|
||||
PixelToMapPoint
|
||||
M
|
||||
MapPoint
|
||||
(hPoint)Point;(Zoom)i
|
||||
PixelToTile
|
||||
M
|
||||
Point
|
||||
(hPoint)Point;
|
||||
SexToDec
|
||||
M
|
||||
f
|
||||
(Value)s
|
||||
'ex: 45°53'36" -> 45,893333
|
||||
DecToSex
|
||||
M
|
||||
s
|
||||
(Value)f(Type)i
|
||||
'ex:45,893333 -> 45°53'36"
|
||||
#Map
|
||||
|
||||
C
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
Geo
|
||||
Map
|
||||
MapPoint
|
||||
MapViewer
|
||||
|
|
|
@ -162,7 +162,7 @@ Private Sub RefreshBoxes()
|
|||
Dim tmpPoint As PointF
|
||||
Dim ll As MapPoint
|
||||
|
||||
fptPixel = MTiles.MapPointToPixel($llCenter, $iZoom) 'Mercator.MetersToPixelsFP(Mercator.MapPointToMetersLL($llCenter), $iZoom)
|
||||
fptPixel = Geo.MapPointToPixel($llCenter, $iZoom) 'Mercator.MetersToPixelsFP(Mercator.MapPointToMetersLL($llCenter), $iZoom)
|
||||
$hPixelBox.X = fptPixel.X - ($iWidth / 2)
|
||||
$hPixelBox.Y = fptPixel.Y - ($iHeight / 2)
|
||||
$hPixelBox.Right = fptPixel.X + ($iWidth / 2)
|
||||
|
|
|
@ -78,7 +78,7 @@ Public Sub View_MouseWheel()
|
|||
|
||||
hPix = New Point($hMap.BoxPixel.X + Mouse.X, $hMap.BoxPixel.Y + Mouse.Y)
|
||||
|
||||
If Mouse.Delta > 0 Then $hMap.Center = MTiles.PixelToMapPoint(hpix, $hmap.Zoom) 'Mercator.MetersToMapPointFP(Mercator.PixelsToMetersP(hpix, $hMap.Zoom))
|
||||
If Mouse.Delta > 0 Then $hMap.Center = Geo.PixelToMapPoint(hpix, $hmap.Zoom) 'Mercator.MetersToMapPointFP(Mercator.PixelsToMetersP(hpix, $hMap.Zoom))
|
||||
|
||||
$hView.Refresh
|
||||
End
|
||||
|
@ -94,7 +94,7 @@ Public Sub View_MouseDown()
|
|||
$hView.Mouse = Mouse.Pointing
|
||||
$iX = Mouse.X
|
||||
$iY = Mouse.Y
|
||||
$pCurCenterPx = MTiles.MapPointToPixel($hmap.Center, $hmap.Zoom) 'Mercator.MetersToPixelsFP(Mercator.MapPointToMetersLL($hMap.Center), $hMap.Zoom)
|
||||
$pCurCenterPx = Geo.MapPointToPixel($hmap.Center, $hmap.Zoom) 'Mercator.MetersToPixelsFP(Mercator.MapPointToMetersLL($hMap.Center), $hMap.Zoom)
|
||||
|
||||
Raise MouseDown
|
||||
End
|
||||
|
@ -118,7 +118,7 @@ Public Sub View_MouseMove()
|
|||
|
||||
hPix.X += $ix - Mouse.X
|
||||
hPix.Y += $iY - Mouse.Y
|
||||
$hmap.Center = MTiles.PixelToMapPoint(hpix, $hmap.Zoom) 'Mercator.MetersToMapPointFP(Mercator.PixelsToMetersP(hPix, $hMap.Zoom))
|
||||
$hmap.Center = Geo.PixelToMapPoint(hpix, $hmap.Zoom) 'Mercator.MetersToMapPointFP(Mercator.PixelsToMetersP(hPix, $hMap.Zoom))
|
||||
'Print hpix.X, hpix.y
|
||||
'$hMapView.CenterLat = hMapPoint.Lat
|
||||
'$hMapView.CenterLon = hMapPoint.Lon
|
||||
|
|
|
@ -48,7 +48,7 @@ Public Sub MapViewer1_MouseDown()
|
|||
|
||||
hmap.Zoom = MapViewer1.map.Zoom + SpinBox1.Value
|
||||
$bLens = True
|
||||
hmap.Center = MTiles.PixelToMapPoint(point(MapViewer1.Map.BoxPixel.X + Mouse.X, MapViewer1.Map.BoxPixel.Y + Mouse.y), MapViewer1.Map.Zoom)
|
||||
hmap.Center = Geo.PixelToMapPoint(point(MapViewer1.Map.BoxPixel.X + Mouse.X, MapViewer1.Map.BoxPixel.Y + Mouse.y), MapViewer1.Map.Zoom)
|
||||
MapViewer1.Lock = True
|
||||
MapViewer1.Refresh
|
||||
Endif
|
||||
|
@ -60,7 +60,7 @@ Public Sub MapViewer1_MouseMove()
|
|||
$iMX = Mouse.X
|
||||
$iMY = Mouse.Y
|
||||
If $bLens Then
|
||||
hmap.Center = MTiles.PixelToMapPoint(Point(MapViewer1.Map.BoxPixel.X + Mouse.X, MapViewer1.Map.BoxPixel.Y + Mouse.y, MapViewer1.Map.Zoom))
|
||||
hmap.Center = Geo.PixelToMapPoint(Point(MapViewer1.Map.BoxPixel.X + Mouse.X, MapViewer1.Map.BoxPixel.Y + Mouse.y, MapViewer1.Map.Zoom))
|
||||
|
||||
Endif
|
||||
|
||||
|
@ -119,7 +119,7 @@ End
|
|||
|
||||
Public Sub Button1_Click()
|
||||
|
||||
MapViewer1.Map.Center = MapPoint(MTiles.SexToDec("45°31'33,33''N"), MTiles.SexToDec("0°18'43,50''W"))
|
||||
MapViewer1.Map.Center = MapPoint(Geo.SexToDec("45°31'33,33''N"), Geo.SexToDec("0°18'43,50''W"))
|
||||
MapViewer1.Map.Zoom = 17
|
||||
MapViewer1.Refresh
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ Public Sub Main()
|
|||
Dim hpoint2 As Point
|
||||
Dim hpmap As MapPoint
|
||||
|
||||
hpmap = MTiles.PixelToMapPoint(hpoint, 1)
|
||||
hpmap = Geo.PixelToMapPoint(hpoint, 1)
|
||||
Print hpmap.Lon, hpmap.Lat
|
||||
hpoint2 = MTiles.MapPointToPixel(hpmap, 1)
|
||||
hpoint2 = Geo.MapPointToPixel(hpmap, 1)
|
||||
Print hpoint2.x, hpoint2.Y
|
||||
End
|
||||
|
||||
|
|
|
@ -90,8 +90,8 @@ Public Sub _Draw()
|
|||
|
||||
'If Not $sVersion Then TryToGetVersion
|
||||
'MapBox
|
||||
iptMinTile = MTiles.PixelToTile(Point(MapBox.X, MapBox.Y))
|
||||
iptMaxTile = MTiles.PixelToTile(Point(MapBox.Right, MapBox.Bottom))
|
||||
iptMinTile = Geo.PixelToTile(Point(MapBox.X, MapBox.Y))
|
||||
iptMaxTile = Geo.PixelToTile(Point(MapBox.Right, MapBox.Bottom))
|
||||
'Print "start"
|
||||
|
||||
For ty = iptMinTile.Y To iptMaxTile.Y
|
||||
|
|
Loading…
Reference in a new issue