OpenLayers 오픈레이어에서 마우스 클릭 위치 좌표값 가져오는 여러가지 방법 > 개발

본문 바로가기
사이트 내 전체검색

개발

OpenLayers 오픈레이어에서 마우스 클릭 위치 좌표값 가져오는 여러가지 방법

페이지 정보

profile_image
작성자 관리자 (61.♡.26.29)
댓글 0건 조회 5,901회 작성일 17-04-22 22:57

본문

오픈레이어로 지도 작업할 때, 지도위에 마우스를 클릭한 위치의 좌표값을 알아내는 방법들이다.

[code]
feature.geometry.getBounds().getCenterLonLat()
[/code]
or

[code]
map.events.register("click", map, function(e) {
    var latlon = map.getLonLatFromViewPortPx(e.xy) ;
    alert(lonlat);
});
[/code]
or

[code]
new OpenLayers.Control.SelectFeature(layer,{
    hover:true,
    eventListeners:{
      onSelect:function(e){
        alert(e.feature.geometry)
    }
});
[/code]
or

[code]
layer.events.on({
            "featureselected": function(e) {     
            alert(e);
            }
});   
[/code]



** 출처 : https://gis.stackexchange.com/questions/22240/openlayers-selectfeature-get-mouse-position

추천0

댓글목록

등록된 댓글이 없습니다.

Total 386건 1 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
386308004-07
3851124002-02
384986001-09
3831190012-25
3821082012-15
381871012-10
380479012-03
379507011-26
378475011-04
3771063009-08
3761330008-11
3751417008-10
3741714007-10
3731202007-03
3721623006-06
3711419004-23
3701414004-20
3692478004-19
3681109004-12
3671751004-11

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.