@@ -46,7 +46,7 @@ function UpdateGeoAxes(obj, geoIndex)
46
46
47
47
% -------------------------------------------------------------------------%
48
48
49
- % -setting latitude axis
49
+ % -setting latitude axis-%
50
50
latTick = geoData .LatitudeAxis .TickValues ;
51
51
52
52
geo.lataxis.range = geoData .LatitudeLimits ;
@@ -61,7 +61,7 @@ function UpdateGeoAxes(obj, geoIndex)
61
61
62
62
% -------------------------------------------------------------------------%
63
63
64
- % -setting longitude axis
64
+ % -setting longitude axis-%
65
65
lonTick = geoData .LongitudeAxis .TickValues ;
66
66
67
67
geo.lonaxis.range = geoData .LongitudeLimits ;
@@ -75,10 +75,61 @@ function UpdateGeoAxes(obj, geoIndex)
75
75
end
76
76
77
77
% -------------------------------------------------------------------------%
78
+
79
+ % -set map center-%
80
+ geo.center.lat = geoData .MapCenter(1 );
81
+ geo.center.lon = geoData .MapCenter(2 );
78
82
79
- % -set geo axes to layout-%
83
+ % -------------------------------------------------------------------------%
84
+
85
+ % -set better resolution-%
86
+ geo.resolution = ' 50' ;
87
+
88
+ % -------------------------------------------------------------------------%
80
89
90
+ % -set geo axes to layout-%
81
91
obj.layout = setfield(obj .layout , sprintf(' geo%d ' , xsource + 1 ), geo );
82
92
83
93
% -------------------------------------------------------------------------%
94
+
95
+ % -TEXT STTINGS-%
96
+ isText = false ;
97
+ child = geoData .Children ;
98
+ t = 1 ;
99
+
100
+ for n= 1 : length(child )
101
+ if strcmpi(child(n ).Type, ' text' )
102
+ isText = true ;
103
+ texts{t } = child(t ).String;
104
+ lats(t ) = child(t ).Position(1 );
105
+ lons(t ) = child(t ).Position(2 );
106
+ sizes(t ) = child(t ).FontSize;
107
+ families{t } = matlab2plotlyfont(child(t ).FontName);
108
+ colors{t } = sprintf(' rgb(%f ,%f ,%f )' , child(t ).Color);
109
+
110
+ if strcmpi(child(t ).HorizontalAlignment, ' left' )
111
+ pos{t } = ' right' ;
112
+ elseif strcmpi(child(t ).HorizontalAlignment, ' right' )
113
+ pos{t } = ' left' ;
114
+ else
115
+ pos{t } = child(t ).HorizontalAlignment;
116
+ end
117
+
118
+ t = t + 1 ;
119
+ end
120
+ end
121
+
122
+ if isText
123
+ obj.data{geoIndex }.type = ' scattergeo' ;
124
+ obj.data{geoIndex }.mode = ' text' ;
125
+ obj.data{geoIndex }.text = texts ;
126
+ obj.data{geoIndex }.lat = lats ;
127
+ obj.data{geoIndex }.lon = lons ;
128
+ obj.data{geoIndex }.geo = obj.data{geoIndex - 1 }.geo;
129
+
130
+ obj.data{geoIndex }.textfont.size = sizes ;
131
+ obj.data{geoIndex }.textfont.color = colors ;
132
+ obj.data{geoIndex }.textfont.family = families ;
133
+ obj.data{geoIndex }.textposition = pos ;
134
+ end
84
135
end
0 commit comments