So in the mobile app I’m working on we want to give the user the possibility to reposition his business’ location on the map. The way we want this to work, visually, is present the user with a map he can drag to set the wanted location in the center of the map view. There’s an image on top of the map to indicate its center. This is what the UI looks like:

When the view to edit the location (the image above) is loaded, I want the map to pan and zoom to the current location. However, I cannot get this to work – the map always seems to zoom to the 0,0 coordinates. This is how I’m trying to achieve this:
<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN>
Map <SPAN class="punctuation token">{</SPAN>
id<SPAN class="punctuation token">:</SPAN> map
anchors<SPAN class="punctuation token">.</SPAN>fill<SPAN class="punctuation token">:</SPAN> parent
wrapAroundEnabled<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN>
rotationByPinchingEnabled<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN>
zoomByPinchingEnabled<SPAN class="punctuation token">:</SPAN> <SPAN class="keyword token">true</SPAN>
ArcGISTiledMapServiceLayer <SPAN class="punctuation token">{</SPAN>
url<SPAN class="punctuation token">:</SPAN> app<SPAN class="punctuation token">.</SPAN>info<SPAN class="punctuation token">.</SPAN><SPAN class="token function">propertyValue</SPAN><SPAN class="punctuation token">(</SPAN> <SPAN class="string token">"urlTilesStreetMap"</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">""</SPAN> <SPAN class="punctuation token">)</SPAN>
<SPAN class="punctuation token">}</SPAN>
Image <SPAN class="punctuation token">{</SPAN>
anchors<SPAN class="punctuation token">.</SPAN>centerIn<SPAN class="punctuation token">:</SPAN> parent
width<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">50</SPAN> <SPAN class="operator token">*</SPAN> AppFramework<SPAN class="punctuation token">.</SPAN>displayScaleFactor
height<SPAN class="punctuation token">:</SPAN> <SPAN class="number token">50</SPAN> <SPAN class="operator token">*</SPAN> AppFramework<SPAN class="punctuation token">.</SPAN>displayScaleFactor
fillMode<SPAN class="punctuation token">:</SPAN> Image<SPAN class="punctuation token">.</SPAN>PreserveAspectCrop
source<SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"../assets/markers/default.png"</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN>
<SPAN class="keyword token">if</SPAN><SPAN class="punctuation token">(</SPAN> visible <SPAN class="operator token">&&</SPAN> root<SPAN class="punctuation token">.</SPAN>feature <SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
<SPAN class="keyword token">var</SPAN> obj <SPAN class="operator token">=</SPAN> ArcGISRuntime<SPAN class="punctuation token">.</SPAN><SPAN class="token function">createObject</SPAN><SPAN class="punctuation token">(</SPAN> <SPAN class="string token">"Feature"</SPAN> <SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
obj<SPAN class="punctuation token">.</SPAN>json <SPAN class="operator token">=</SPAN> root<SPAN class="punctuation token">.</SPAN>feature<SPAN class="punctuation token">;</SPAN>
map<SPAN class="punctuation token">.</SPAN><SPAN class="token function">zoomTo</SPAN><SPAN class="punctuation token">(</SPAN> obj<SPAN class="punctuation token">.</SPAN>geometry <SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>Note that root.feature is a JSON object like this:
JSON<SPAN class="punctuation token">.</SPAN><SPAN class="token function">stringify</SPAN><SPAN class="punctuation token">(</SPAN> obj<SPAN class="punctuation token">.</SPAN>json<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">null</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">6</SPAN> <SPAN class="punctuation token">)</SPAN>
<SPAN class="comment token">// output:</SPAN>
<SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"attributes"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"GlobalID"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="string token">"{45AC36D8-3FDA-4753-9ECF-0CBA318F98A2}"</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"OBJECTID"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">32368</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN><SPAN class="punctuation token">.</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"geometry"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"spatialReference"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="punctuation token">{</SPAN>
<SPAN class="string token">"wkid"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">4326</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"x"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">14.48243610000003</SPAN><SPAN class="punctuation token">,</SPAN>
<SPAN class="string token">"y"</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">35.90565804800008</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>How can I zoom the map to the location of root.feature?
And extra question: how can I get the x and y of the center of the map to save as the new location?
Thanks in advance.