Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.



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
        if (zoom) {
            console.log('center and ZOOM');
  , 10);
        } else {
    } catch(err) {}


Console prints 'center and ZOOM' as expected, but doesn't actually zoom. I'm displaying a WMS layer without a basemap.

share|improve this question
up vote 6 down vote accepted

I have used similar functionality in my map.

-Created doIdentify() function and called on click event.

function doIdentify(evt) {,6);

You can check sample code at JSFiddle.

Please let us know if you get any error message.

share|improve this answer
Thank you, your solution works. – ObviousCat Apr 24 '13 at 19:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.