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

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

개발

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

페이지 정보

profile_image
작성자 관리자 (61.♡.26.29)
댓글 0건 조회 6,088회 작성일 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 387건 1 페이지
  • RSS
개발 목록
번호 제목 조회 추천 날짜
38793005-27
386559004-07
3851382002-02
3841253001-09
3831541012-25
3821258012-15
3811006012-10
380598012-03
379704011-26
378607011-04
3771236009-08
3761544008-11
3751623008-10
3741940007-10
3731359007-03
3721837006-06
3711611004-23
3701632004-20
3692734004-19
3681309004-12

검색


사이트 정보

Copyright © Baragi.Net. All rights reserved.