Map OpenMap()

Returns:
Map object

All the parameters are located in the Web.config file.

Public Function OpenMap()
    Dim conn, map
    conn = new IMSConnection()

    conn.setConnectionURL( GetConfigStr("par_ServerUrl") )
    conn.setGroup( GetConfigStr("par_Groupid") )
    conn.setUserName( GetConfigStr("par_Uid") )
    conn.setLocale( GetConfigStr("par_Lang"), GetConfigStr("par_Country") )
    conn.setCharset("")

    map = conn.loadMap( GetConfigStr("par_MapName") )

    ' set image size
    map.setImageSize( GetConfigInt("par_Width"), GetConfigInt("par_Height") )

    ' set location
    Dim location
    location = new Location()
    location.setString(GetConfigStr("par_Location"))
    map.setLocation(location)

    ' set measure units
    map.setMeasureUnits( GetConfigInt("par_Units") )

    OpenMap = map
End Function

Public Function GetConfigStr(keyName As String) As String
    GetConfigStr = CStr(ConfigurationSettings.AppSettings(keyName))
End Function

Public Function GetConfigInt(keyName As String) As Long
    GetConfigInt = CInt(ConfigurationSettings.AppSettings(keyName))
End Function