You are on page 1of 18

11HCA - Khoa CNTT - i hc Khoa Hc T Nhin TP.

HCM

Seminar Google Map API


GVHD: Thy Nguyn Huy Khnh Nhm: CIT 1142066: Nguyn Hng Ph 1142025: Nguyn Duy H 1141423: Nguyn Quc Qun
Cng ngh lp trnh hin i Google Map API

Directions API

Cng ngh lp trnh hin i Google Map API

11HCA - Khoa CNTT - i hc Khoa Hc T Nhin TP.HCM

Cng ngh lp trnh hin i Google Map API

Directions API

Webservice API
Mt Directions API c dng
http://maps.googleapis.com/maps/ap i/directions/output?parameters

output:
XML JSON

Directions API

Webservice API
parameters:
origin: a ch hoc kinh /v ca v tr bt u destination: a ch hoc kinh /v ca v tr kt thc sensor: s dng thit b nh v v tr hay khng

Directions API

Webservice API
D liu tr v
status: trng thi kt qu tr v legs[]: cc tuyn ng i step[]:cc bc i

Directions API

Javascript API
s dng ta chn on script sau vo header:
<script src="https://maps.googleapis.com/m aps/api/js?v=3.exp&sensor=false">< /script>

Directions API

Javascript API
ng k mt key ca Google Maps
<script src=http://maps.googleapis.com/ma ps/api/js?key=AIzaSyBHc01iDz0w0xh 3uZShTzKWMO6dBEWMPw&sensor=false&callback=initiali ze>

</script>
8

Directions API

Javascript API
S dng v gi cc phng thc thc thi
google.maps.DirectionsService() //gi i tng ca Service google.maps.DirectionsRenderer( ) //hin th kt qu

Geocoding API

Cng ngh lp trnh hin i Google Map API

11HCA - Khoa CNTT - i hc Khoa Hc T Nhin TP.HCM

Cng ngh lp trnh hin i Google Map API

Geocoding API

Webservice API
Mt Geocoding API c dng
https://maps.googleapis.com/maps/a pi/ geocode /output?parameters

output:
XML JSON

12

Geocoding API

Webservice API
parameters:
address: a ch hoc kinh /v sensor: s dng thit b nh v v tr hay khng

13

Geocoding API

Webservice API
D liu tr v
Trng thi tr v types[]:loi a im tr v l loi g address_components[]: cha cc thnh phn a ch ring bit geometry: cha cc thng tin v a im partial_match: cho bit kt qu tr v c ph hp vi phm vi hay khng

14

Geocoding API

Javascript API
s dng ta chn on script sau vo header:
<script src="https://maps.googleapis.com/m aps/api/js?v=3.exp&sensor=false">< /script>

15

Geocoding API

Javascript API
ng k mt key ca Google Maps
<script src=http://maps.googleapis.com/ma ps/api/js?key=AIzaSyBHc01iDz0w0xh 3uZShTzKWMO6dBEWMPw&sensor=false&callback=initiali ze>

</script>
16

Geocoding API

Javascript API
S dng v gi cc phng thc thc thi
google.maps.Geocoder(); //gi i tng ca Service geocode()//geocode a im

17

Thanks you!

Cng ngh lp trnh hin i Google Map API

You might also like