Javascript & JQuery & CSS > Google Maps API + ÇöÀç Á¢¼Ó À§Ä¡ - À§µµ/°æµµ Á¤º¸ »Ì±â
µî·ÏÀÏ : 2017-07-14 17:07
Á¶È¸¼ö : 53,188
//ÇöÀç À§Ä¡¿¡¼ À§µµ/°æµµ »Ì±â
function getLocation_cord()
{
if (navigator.geolocation)
{
navigator.geolocation.getCurrentPosition(successCallback,errorCallback);
} else
{
$("#map").html("Geolocation is not supported by this browser.");
alert('´Ü¸»±â¿¡¼ ÇöÀç À§Ä¡¸¦ »ç¿ëÇÒ ¼ö ¾ø½À´Ï´Ù.');
}
}
//¼º°ø½Ã Callback ÇÔ¼ö
function successCallback(wp_position)
{
$("#setPosition").html("Latitude: " + wp_position.coords.latitude + "<br> Longitude: " + wp_position.coords.longitude);
}
//½ÇÆнà Callback ÇÔ¼ö
function errorCallback(wp_position_error)
{
$("#setPosition").html("error.code : "+ wp_position_error.code + " , error.message : " + wp_position_error.message)
}
javascript ¸¦ ÀÌ¿ëÇÏ¿© ÇöÀç Á¢¼Ó ºê¶ó¿ìÁ®ÀÇ À§µµ/°æµµ¸¦ »Ì´Â ¼Ò½º ÀÔ´Ï´Ù.