Set View Position

Customizing the map so that it loads or moves to a specific location is handled with the mapView object. The code below shows how to load the map at specific x and y coordinates with a width and height of the viewport.

micello.maps.init (apikey, mapInit);
var mapView;
function mapInit () {
    mapControl  =  new  micello.maps.MapControl('mapElement');
    mapDataObject  =  mapControl.getMapData();
    mapView  =  mapControl.getMapView();
    mapDataObject.mapChanged = onMapChanged;
function onMapChanged (e) {
    if (e.comLoad) {
        var centerX = 1300;
        var centerY = 400;
        var width = 250;
        var height = 250;
        mapView.setView(centerX, centerY, width, height);

This example uses a mapChanged Override, above on line 10. Setting the map view may also be done in response to a user's click. Find out how to reveal map coordinates by clicking the map in the mapClick Override example.

Enter new values for x, y, width, and height and click 'Set' to see the map load at different positions.