1
+ <!DOCTYPE html>
2
+ < html >
3
+
4
+ < head lang ="en ">
5
+ < meta charset ="UTF-8 ">
6
+ <!--angular-->
7
+ < script src ="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js "> </ script >
8
+ <!-- Bootstrap stuff -->
9
+ < link rel ="stylesheet " href ="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css ">
10
+ < link rel ="stylesheet " href ="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap-theme.min.css ">
11
+ < script src ="https://code.jquery.com/jquery-1.10.2.min.js "> </ script >
12
+ < script src ="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js "> </ script >
13
+ < script type ="text/javascript " src ='https://maps.google.com/maps/api/js?sensor=false&libraries=places '> </ script >
14
+ < script src ="../dist/locationpicker.jquery.min.js "> </ script >
15
+
16
+ < script src ="../src/angularLocationpicker.jquery.js "> </ script >
17
+
18
+ < title > Angular example</ title >
19
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
20
+ </ head >
21
+
22
+ < body ng-app ="locationpickerApp " ng-controller ="locationpickerController ">
23
+ < div class ="form-horizontal " style ="width: 550px ">
24
+ < div class ="form-group ">
25
+ < label class ="col-sm-2 control-label "> Location:</ label >
26
+
27
+ < div class ="col-sm-10 ">
28
+ < input type ="text " class ="form-control " id ="us3-address "/>
29
+ </ div >
30
+ </ div >
31
+ < div class ="form-group ">
32
+ < label class ="col-sm-2 control-label "> Radius:</ label >
33
+
34
+ < div class ="col-sm-5 ">
35
+ < input type ="text " class ="form-control " id ="us3-radius "/>
36
+ </ div >
37
+ </ div >
38
+
39
+ <!--Map by element. Also it can be attribute-->
40
+ < jquery-locationpicker options ="locationpickerOptions "> </ jquery-locationpicker >
41
+
42
+ < div class ="clearfix "> </ div >
43
+ < div class ="m-t-small ">
44
+ < label class ="p-r-small col-sm-1 control-label "> Lat.:</ label >
45
+
46
+ < div class ="col-sm-3 ">
47
+ < input type ="text " class ="form-control " style ="width: 110px " id ="us3-lat "/>
48
+ </ div >
49
+ < label class ="p-r-small col-sm-2 control-label "> Long.:</ label >
50
+
51
+ < div class ="col-sm-3 ">
52
+ < input type ="text " class ="form-control " style ="width: 110px " id ="us3-lon "/>
53
+ </ div >
54
+ </ div >
55
+ < div class ="clearfix "> </ div >
56
+ </ div >
57
+ < script >
58
+ angular . module ( 'locationpickerApp' , [ 'angular-jquery-locationpicker' ] )
59
+ . controller ( 'locationpickerController' , [
60
+ '$scope' ,
61
+ function ( $scope ) {
62
+ $scope . locationpickerOptions = {
63
+ location : {
64
+ latitude : 46.15242437752303 ,
65
+ longitude : 2.7470703125
66
+ } ,
67
+ inputBinding : {
68
+ latitudeInput : $ ( '#us3-lat' ) ,
69
+ longitudeInput : $ ( '#us3-lon' ) ,
70
+ radiusInput : $ ( '#us3-radius' ) ,
71
+ locationNameInput : $ ( '#us3-address' )
72
+ } ,
73
+ radius : 300 ,
74
+ enableAutocomplete : true
75
+ } ;
76
+ }
77
+ ] ) ;
78
+ </ script >
79
+ </ body >
80
+
81
+ </ html >
0 commit comments