I'm trying to get the map to move and zoom in to a point when a function is executed. Point gets selected, but without zoom. Interestingly when I zoom in to a random location and then execute the method I'll get zoomed out a bit and moved to correct position.
drawPointToMap(true);
Code:
function drawPointToMap(zoom) {
var lat = $('#id_latitude').val();
var lon = $('#id_longitude').val();
if (lat != '' && lon != '' && !isNaN(lat) && !isNaN(lon)) {
try {
var point = new esri.geometry.Point({
latitude: lat,
longitude: lon
});
mapHandler.drawToMap(point);
if (zoom) {
console.log('center and ZOOM');
mapHandler.map.centerAndZoom(point, 10);
} else {
mapHandler.map.centerAt(point);
}
} catch(err) {}
}
}
Console prints 'center and ZOOM' as expected, but doesn't actually zoom. I'm displaying a WMS layer without a basemap.