Select to view content in your preferred language

Map.CenterAndZoom Issue

3525
5
03-06-2014 02:01 AM
NikitaWachstaub
Deactivated User
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
Deactivated User
0 Kudos
KenBuja
MVP Esteemed Contributor
Can you post your code or a working sample at JSBin that shows the problem?
0 Kudos
NikitaWachstaub
Deactivated User
The problem is already solved)
0 Kudos
JacquelineKovarik
Deactivated User

Can you please post the solution here?

0 Kudos
KeithGanzenmuller
Frequent Contributor
What was the solution?
0 Kudos