When I begin my application with Street as basemap layer and two more feature layers, I have 3 layers in total
map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">getLayer</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">.</SPAN>size<SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
But when I change the basemap layer to Gray_base or Hybrid:
map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setMapOptions</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">MapOptions</SPAN><SPAN class="punctuation token">(</SPAN>MapType<SPAN class="punctuation token">.</SPAN>GRAY_BASE<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
One more layer is added (4 after the change). If I change again to other basemap not being GRAY_BASE or HYBRID the extra layer is removed (having 3 as initially)
Why this happens? I think it's not an error in my code because even the sample code (the MapOptionsApp example) shows this behavior.
What can I do to avoid this extra layer?
Beforehand thanks a lot.