Map.CenterAndZoom Issue

3108
5
03-06-2014 02:01 AM
NikitaWachstaub
New Contributor
Good day,

I cannot get a center and zooming funktion in my JS-Viewer. Hier is the code:

function DrawPointAndZoom() {
        try {

            var mylat = 29.818008;
            var mylong = 5.423178;
            var latLongPoint = new esri.geometry.Point(mylat, mylong, new esri.SpatialReference({ wkid: 4326 }));
            var mercator = esri.geometry.geographicToWebMercator(latLongPoint);
            map.centerAndZoom(mercator, 10)
        }
        catch (err) {
            alert(err);
        }
}

I get an error:    TypeError: map.centerAndZoom is not a function

What can be the problem?
0 Kudos
5 Replies
NikitaWachstaub
New Contributor
0 Kudos
KenBuja
MVP Esteemed Contributor
Can you post your code or a working sample at JSBin that shows the problem?
0 Kudos
NikitaWachstaub
New Contributor
The problem is already solved)
0 Kudos
JacquelineKovarik
New Contributor III

Can you please post the solution here?

0 Kudos
KeithGanzenmuller
Occasional Contributor II
What was the solution?
0 Kudos