Toggle navigation
Toggle navigation
This project
Loading...
Sign in
박정인
/
opensource
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
박정인
2017-12-05 22:31:58 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cb058590fc49382c8b6de4ee02451f2f6e396ec5
cb058590
0 parents
htmlmain
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
googlemaps.html
googlemaps.html
0 → 100644
View file @
cb05859
<!DOCTYPE html>
<html>
<head>
<body>
<form>
<div>
구 입력 :
<br/><input
type=
"text"
name=
"id"
value=
""
></div>
<div>
도로명:
<br/><input
type=
"password"
name=
"pwd"
value=
""
></div>
</form>
<script
src=
"http://maps.googleapis.com/maps/api/js"
>
<
/body
>
</script>
<script>
var
map
;
var
Seoul
=
new
google
.
maps
.
LatLng
(
37.551920
,
126.994615
);
// Add a Home control that returns the user to Suwon
function
HomeControl
(
controlDiv
,
map
)
{
controlDiv
.
style
.
padding
=
'5px'
;
var
controlUI
=
document
.
createElement
(
'div'
);
controlUI
.
style
.
backgroundColor
=
'yellow'
;
controlUI
.
style
.
border
=
'1px solid'
;
controlUI
.
style
.
cursor
=
'pointer'
;
controlUI
.
style
.
textAlign
=
'center'
;
controlUI
.
title
=
'Set map to Seoul'
;
controlDiv
.
appendChild
(
controlUI
);
var
controlText
=
document
.
createElement
(
'div'
);
controlText
.
style
.
fontFamily
=
'Arial,sans-serif'
;
controlText
.
style
.
fontSize
=
'12px'
;
controlText
.
style
.
paddingLeft
=
'4px'
;
controlText
.
style
.
paddingRight
=
'4px'
;
controlText
.
innerHTML
=
'<b>Home<b>'
controlUI
.
appendChild
(
controlText
);
// Setup click-event listener: simply set the map to Suwon
google
.
maps
.
event
.
addDomListener
(
controlUI
,
'click'
,
function
()
{
map
.
setCenter
(
Seoul
,
37.551920
,
127.994615
)
});
}
function
initialize
()
{
var
mapDiv
=
document
.
getElementById
(
'googleMap'
);
var
myOptions
=
{
zoom
:
12
,
center
:
Seoul
,
mapTypeId
:
google
.
maps
.
MapTypeId
.
ROADMAP
}
map
=
new
google
.
maps
.
Map
(
mapDiv
,
myOptions
);
// Create a DIV to hold the control and call HomeControl()
var
homeControlDiv
=
document
.
createElement
(
'div'
);
var
homeControl
=
new
HomeControl
(
homeControlDiv
,
map
);
// homeControlDiv.index = 1;
map
.
controls
[
google
.
maps
.
ControlPosition
.
TOP_RIGHT
].
push
(
homeControlDiv
);
}
google
.
maps
.
event
.
addDomListener
(
window
,
'load'
,
initialize
);
</script>
</head>
<body>
<div
id=
"googleMap"
style=
"width:700px;height:500px;"
></div>
</body>
</html>
Please
register
or
login
to post a comment