FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SharpMap/Examples/MapWindowConference/Examples.cs at main · SharpMap/SharpMap · GitHub
SharpMap
SharpMap
Repository navigation
Code
Issues
42
(42)
Pull requests
6
(6)
Discussions
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
SharpMap
/
Examples
/
MapWindowConference
/
Examples.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
99 lines (74 loc) · 3.26 KB
Breadcrumbs
SharpMap
/
Examples
/
MapWindowConference
/
Examples.cs
Copy path
File metadata and controls
99 lines (74 loc) · 3.26 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
using
System
.
Drawing
;
using
BruTile
.
Web
;
namespace
MapWindowConference
{
public
static
class
Examples
{
public
static
void
Example1
(
)
{
var
map
=
new
SharpMap
.
Map
(
new
Size
(
1280
,
1084
)
)
;
SharpMap
.
Data
.
Providers
.
IProvider
provider
=
new
SharpMap
.
Data
.
Providers
.
ShapeFile
(
@"C:\temp\Data\niedersachsen.shp\railways.shp"
)
;
var
vl
=
new
SharpMap
.
Layers
.
VectorLayer
(
"Railways"
,
provider
)
;
map
.
Layers
.
Add
(
vl
)
;
map
.
ZoomToBox
(
vl
.
Envelope
)
;
var
mapImage
=
map
.
GetMap
(
)
;
mapImage
.
Save
(
"Example1.png"
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Png
)
;
}
public
static
void
Example2
(
)
{
var
map
=
new
SharpMap
.
Map
(
new
Size
(
1280
,
1084
)
)
;
SharpMap
.
Data
.
Providers
.
IProvider
provider
=
new
SharpMap
.
Data
.
Providers
.
ShapeFile
(
@"C:\temp\Data\niedersachsen.shp\railways.shp"
)
;
var
style
=
new
SharpMap
.
Styles
.
VectorStyle
(
)
;
style
.
Line
.
Brush
=
Brushes
.
White
;
style
.
Line
.
DashPattern
=
new
float
[
]
{
4f
,
4f
}
;
style
.
Line
.
Width
=
4
;
style
.
EnableOutline
=
true
;
style
.
Outline
.
Brush
=
Brushes
.
Black
;
style
.
Outline
.
Width
=
6
;
var
vl
=
new
SharpMap
.
Layers
.
VectorLayer
(
"Railways"
,
provider
)
{
Style
=
style
}
;
map
.
Layers
.
Add
(
vl
)
;
var
env
=
vl
.
Envelope
;
env
.
ExpandBy
(
-
0.45f
*
env
.
Width
,
-
0.45
*
env
.
Height
)
;
map
.
ZoomToBox
(
env
)
;
var
mapImage
=
map
.
GetMap
(
)
;
mapImage
.
Save
(
"Example2.png"
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Png
)
;
}
public
static
void
Example3
(
)
{
var
map
=
new
SharpMap
.
Map
(
new
Size
(
1280
,
1084
)
)
;
SharpMap
.
Data
.
Providers
.
IProvider
provider
=
new
SharpMap
.
Data
.
Providers
.
ShapeFile
(
@"C:\temp\Data\niedersachsen.shp\railways.shp"
)
;
var
cls
=
new
SharpMap
.
Rendering
.
Symbolizer
.
CachedLineSymbolizer
(
)
;
cls
.
LineSymbolizeHandlers
.
Add
(
new
SharpMap
.
Rendering
.
Symbolizer
.
PlainLineSymbolizeHandler
{
Line
=
new
System
.
Drawing
.
Pen
(
System
.
Drawing
.
Color
.
Gold
,
2
)
}
)
;
var
wls
=
new
SharpMap
.
Rendering
.
Symbolizer
.
WarpedLineSymbolizeHander
{
Pattern
=
SharpMap
.
Rendering
.
Symbolizer
.
WarpedLineSymbolizer
.
GetGreaterSeries
(
3
,
3
)
,
Line
=
new
System
.
Drawing
.
Pen
(
System
.
Drawing
.
Color
.
Firebrick
,
1
)
,
Interval
=
20
}
;
cls
.
LineSymbolizeHandlers
.
Add
(
wls
)
;
var
vl
=
new
SharpMap
.
Layers
.
Symbolizer
.
LinealVectorLayer
(
"Railways"
,
provider
)
;
vl
.
Symbolizer
=
cls
;
map
.
Layers
.
Add
(
vl
)
;
var
env
=
vl
.
Envelope
;
env
.
ExpandBy
(
-
0.45f
*
env
.
Width
,
-
0.45
*
env
.
Height
)
;
map
.
ZoomToBox
(
env
)
;
var
mapImage
=
map
.
GetMap
(
)
;
mapImage
.
Save
(
"Example3.png"
,
System
.
Drawing
.
Imaging
.
ImageFormat
.
Png
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL