@@ -46,7 +46,7 @@ function UpdateGeoAxes(obj, geoIndex)
4646
4747 % -------------------------------------------------------------------------%
4848
49- % -setting latitude axis
49+ % -setting latitude axis-%
5050 latTick = geoData .LatitudeAxis .TickValues ;
5151
5252 geo.lataxis.range = geoData .LatitudeLimits ;
@@ -61,7 +61,7 @@ function UpdateGeoAxes(obj, geoIndex)
6161
6262 % -------------------------------------------------------------------------%
6363
64- % -setting longitude axis
64+ % -setting longitude axis-%
6565 lonTick = geoData .LongitudeAxis .TickValues ;
6666
6767 geo.lonaxis.range = geoData .LongitudeLimits ;
@@ -75,10 +75,61 @@ function UpdateGeoAxes(obj, geoIndex)
7575 end
7676
7777 % -------------------------------------------------------------------------%
78+
79+ % -set map center-%
80+ geo.center.lat = geoData .MapCenter(1 );
81+ geo.center.lon = geoData .MapCenter(2 );
7882
79- % -set geo axes to layout-%
83+ % -------------------------------------------------------------------------%
84+
85+ % -set better resolution-%
86+ geo.resolution = ' 50' ;
87+
88+ % -------------------------------------------------------------------------%
8089
90+ % -set geo axes to layout-%
8191 obj.layout = setfield(obj .layout , sprintf(' geo%d ' , xsource + 1 ), geo );
8292
8393 % -------------------------------------------------------------------------%
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
84135end
0 commit comments