At 08:51 AM 06/23/1999 +0100, Graham Hyde wrote:
>Can anybody help?
>
>This is a question of how to label a map window with geographical labels:
>
>When we have produced a map of e.g. the Northeast Atlantic with some 
>cruise tracks from a research vessel in the Norwegian Sea, and we want to 
>label and mark the border of the frame (mapwindow) with small tick-marks 
>for each lattitude and longitude (maybe also with 1/2 degree tick-marks, 
>etc.), there is no easy way to do that, if we don't want to have the grids 
>on the map, but only the markers with appropriate labels.
>
>There should be a macro that provide the tickmarks and the degree labels 
>that we desire around the border of the map (mapwindow). Then when the 
>zoom is changed etc. the macro should just re-run to get the tick-marks 
>and lables in the right place. At the moment weI have to manually create 
>the tick-marks and align them to the degree grid, label the degrees (done 
>automatic), copy the the tick-marks and the degree labels to a new 
>layer/cosmetic, and then delete the degree grid again (because we don't 
>want the map to include the degree grid throughout the map). If this was a 
>once affair, it would be ok, but this has to be done for every different 
>map or different zoom.


One way I've done this on occasion is to have a grid of the cells you want 
(1/2 degrees in this case), and select from that table all objects that 
intersect the active mapper's visible area into another table. Then create 
a temporary polygon into the cosmetic layer that is maybe 5% inside the 
mapper window's edge. Erase the grid cells with the temp polygon then clear 
your temp polygon. Now you can simply turn on automatic labels on the new / 
revised grid cell layer. It will give you bands instead of tic marks, but 
it may be worth it.

If you have MapBasic, here's another approach:

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Include "MapBasic.def"

Declare Function IsTableOpen(ByVal sTabName As String) As Logical

If IsTableOpen("Graticule") = TRUE Then
         Close Table Graticule
End If


dim ID as Integer
dim i, Tic, MinX, MaxX, MinY, MaxY as Float

id = FrontWindow()
tic = .5

If WindowInfo(id,WIN_INFO_TYPE) <> WIN_MAPPER Then
      Note "Window is not a Mapper Window."
      End Program
End If

If WindowInfo(id,WIN_INFO_STATE) <> WIN_STATE_NORMAL Then
      Set Window id Restore
End If


Create Table Graticule
         (X1             Float,
          Y1             Float,
          X2             Float,
          Y2             Float,
          Label  Float)
File "c:\temp\Graticule.TAB"

MinX = MapperInfo(id,MAPPER_INFO_MINX)
MaxX = MapperInfo(id,MAPPER_INFO_MAXX)
MinY = MapperInfo(id,MAPPER_INFO_MINY)
MaxY = MapperInfo(id,MAPPER_INFO_MAXY)



For i = int(MinX/Tic)*Tic to int(MaxX/Tic)*Tic step Tic
         Insert into Graticule (X1, Y1, X2, Y2, Label)
                 Values (i, MinY, i, MinY+(MaxY-MinY)*.03, i)
         Insert into Graticule (X1, Y1, X2, Y2, Label)
                 Values (i, MaxY, i, MaxY-(MaxY-MinY)*.03, i)
Next

For i = int(MinY/Tic)*Tic to int(MaxY/Tic)*Tic step Tic
         Insert into Graticule (X1, Y1, X2, Y2, Label)
                 Values (MinX, i, MinX+(MaxX-MinX)*.03, i, i)
         Insert into Graticule (X1, Y1, X2, Y2, Label)
                 Values (MaxX, i, MaxX-(MaxX-MinX)*.03, i, i)
Next


Create Map For Graticule CoordSys Earth Projection 1, 33
Update Graticule Set Obj = CreateLine(x1, y1, x2, y2)

Add Map Window ID
         Layer Graticule
Set Map Layer 1
         Display Global
         Global Line(1,2,0)
         Label With Format$(Label,"#.0")
         Position Center
       Parallel Off Auto On Overlap On Duplicates On
         Visibility On
         Font ("Arial",1,9,0)

End Program

Function IsTableOpen(ByVal sTabName As String) As Logical
         OnError Goto NoTable
         Dim l As Logical
         l = TableInfo(sTabName, TAB_INFO_READONLY)
         IsTableOpen = TRUE
         Exit Function
NoTable:
         IsTableOpen = FALSE
         Exit Function
End Function

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



Steve Wallace
GIS & Market Information Manager
Florida Farm Bureau Insurance Companies

----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to