Hi guys
I have a query, I am printing several points (lat, long) on the map and want to know that the map center (lat, long) in order to show all the printed dots. Can someone help me please!!!
George,
There is a time to use centerAndZoom but what you described would better be using by setting the maps extent using
map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setExtent</SPAN><SPAN class="punctuation token">(</SPAN>graphicsUtils<SPAN class="punctuation token">.</SPAN><SPAN class="token function">graphicsExtent</SPAN><SPAN class="punctuation token">(</SPAN>yourArrayofGraphics<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">true</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
If you want the center of the map then you use
map<SPAN class="punctuation token">.</SPAN>extent<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getCenter</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
or
map<SPAN class="punctuation token">.</SPAN>geographicExtent<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getCenter</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
if it is the center of the graphics you are adding then you will use
graphicsUtils<SPAN class="punctuation token">.</SPAN><SPAN class="token function">graphicsExtent</SPAN><SPAN class="punctuation token">(</SPAN>yourArrayofGraphics<SPAN class="punctuation token">)</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
.
thank you very much, and one more question as determined zoom to show all points on my map.
???
Sorry I'm new to the use of this API.and I have the heart to my map, now I need is to know the zoom level so that all points are shown on the map.
I'm using this map.centerAndZoom (point, zoom);
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.