SmartMap Tutorial > SmartMap Event > OnCreate Event
 
  • SmartMap 초기화시 설정
  • OnCreate 이벤트는 Smartmap 생성시 발생하는 이벤트 각종 초기화 작업은 여기서 하도록 합니다.
    Map 초기화 설정이 잘못 되면 Licnese 오류나 웹페이지가 열리지 않아 SmartMap을 실행되지 않을수도 있습니다.
    
     
  • 예제코드 :SmartMap 초기화
  • <html>
     <head>
      <script language="javascript">
       function MapOnCreate(){
        //License 파일 경로
        Map.LicenseInfoPath = "http://localhost/Theme/KSYS.SLC"; 
        //지도 Data를 받아오는 경로 TMD 이전까지 지정
        Map.DataMan.MapDataPath = "http://localhost/MapData";
        //ThemePath 경로
        Map.DataMan.ThemePath = "http://localhost/Theme/";
        //Theme 파일 설정. ThemePath 밑에서 읽어 온다.
        Map.ThemeMan.FileName = "SmartMap.smt";
        //나침반 이미지
        Map.CompassMan.ImagePath = "http://localhost/c_img/map/compass.bmp";
    
        //Map에 변경사항을 자동으로 저장한다.
        Map.CtrlMan.AutoConditionSave = true;
        //14Level을 논리적으로 나누어, 54Level로 Wheel을 이용해 조정한다.
        Map.CtrlMan.UseDatailLevel = true;
        //사용자 PC에 저장되어 있는 Map상태정보를 불러온다.
        Map.CtrlMan.RestoreCondition();
        //행정동 코드를 연결한다.
        Map.AdminMan.fileName = = "SmartMap.PMA"; 
        //Index Map을 표시한다.
        Map.IndexMap.Visible = true;
        //마우스 드래그 시 맵의 그리는 방법 결정
        Map.CtrlMan.MapDragMode = 200;
        //layer object, POI등 화면 변화가 많은 경우 속도를 향상한다.
        Map.TripleBuffered = true;
        //전체 Hint표출 제어
        Map.ShowHint = true;
        //보이는 문자만 Hint표시 1(전체), 0(보이지 않음)
        Map.MapMan.ShowTextHint = 0;
        //GIF Image를 사용하는 경우 GIF의 Animation을 조정한다.
        Map.AnimationInterval = 500;
        //조망보기 모드일 경우와 아닌 경우의 시점 설정
        if(Map.CtrlMan.BirdView){
        Map.CtrlMan.ViewCenter = 70;
        }else{
        Map.CtrlMan.ViewCenter = 50;
        } 
        //layer, POI등의 표출을 빨리 처리할 수 있다.
        Map.TripleBuffered = true;
        //맵에 포커스를 적용한다.
        Map.SetFocus();
        //Progress Bar설정
        Map.UIMan.ProgressBar_Visible = true;
        //Graphic Mode
        Map.UIMan.ProgressBar_TYpe = 1;
      }
      </script>
      <script language="javascript" for="Map" event="OnCreate">
       //지도 초기화 시키는 이벤트
       MapOnCreate();
     </head>
     <body>
     //지도 START /////////////////////////////////////////////
      <table>
        <tr>
          <td><script src="js/SmartMap.Object.js"></script></td>
      </tr> 
      </table>
      //지도 END ///////////////////////////////////////////////
     </body>
    </html>
    
    
    SmartMap.Object.js 파일 내용 : SmartMap 의 ActiveX 를 적용합니다.
    // Start /////////////////
    document.write("<object id='Map' classid='clsid:5797A411-BD4D-4896-9A89-415A902430B6' 
    codebase='http://localhost/bin/SmartMap.cab#version=3,1,4,64' width=100% height=100%></objec> ");
    // End   /////////////////
    
    
    
     
  • Smartmap 생성시 발생하는 이벤트 각종 초기화 합니다.
  •  
    ZoomOut
    Zoom 13
    Zoom 12
    Zoom 11
    Zoom 10
    Zoom 9
    Zoom 8
    Zoom 7
    Zoom 6
    Zoom 5
    Zoom 4
    Zoom 3
    Zoom 2
    Zoom 1
    Zoom 0
    ZoomIn
    ZoomIn ZoomOut 지도회전 뒤로 앞으로 조망보기 입체보기 글자 보이기 클립보드로 복사 저장하기 폴리곤 폴리라인 폴리곤삭제 범위측정 거리측정 거리측정삭제 객체편집 Theme설정
     
    top