Browse files

modification to location lookup method and plugin grails version

  • Loading branch information...
1 parent 92c926f commit a26309d2ee3d6652d9a5c6a0346e9f7c78adda48 @bhagwat bhagwat committed Feb 3, 2011
Showing with 10 additions and 6 deletions.
  1. +1 −1 GoogleMapGrailsPlugin.groovy
  2. +1 −1 plugin.xml
  3. +8 −4 web-app/js/map.init.js
View
2 GoogleMapGrailsPlugin.groovy
@@ -5,7 +5,7 @@ class GoogleMapGrailsPlugin {
// the plugin version
def version = "0.1"
// the version or versions of Grails the plugin is designed for
- def grailsVersion = "1.3.6 > *"
+ def grailsVersion = "1.3.0 > *"
def dependsOn = ['jquery': '1.4.2 > *']
View
2 plugin.xml
@@ -1,4 +1,4 @@
-<plugin name='google-map' version='0.1' grailsVersion='1.3.6 &gt; *'>
+<plugin name='google-map' version='0.1' grailsVersion='1.3.0 &gt; *'>
<author>Bhagwat Kumar</author>
<authorEmail>bhagwat@intelligrape.com</authorEmail>
<title>Google Map</title>
View
12 web-app/js/map.init.js
@@ -177,7 +177,7 @@ function GoogleMapManager() {
});
},
- updateHomeLocationMarker:function (map, addressOrLatLng) {
+ updateHomeLocationMarker:function (map, addressOrLatLng, successHandler, errorHandler) {
addressLookUp = getGeoCoder();
addressLookUp.geocode({'address': addressOrLatLng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
@@ -392,14 +392,18 @@ function GoogleMapManager() {
});
},
- codeLatLng: function (addressOrLatLng, callBackFunction) {
+ codeLatLng: function (addressOrLatLng, successHandler, errorHandler) {
var addressLookup = getGeoCoder();
if (addressLookup) {
addressLookup.geocode({'address': addressOrLatLng}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
- callBackFunction(results);
+ successHandler(results);
} else {
- alert(messages["geoCoderError"]);
+ if(errorHandler){
+ errorHandler(results, status);
+ }else{
+ alert(messages["geoCoderError"]);
+ }
}
});
}

0 comments on commit a26309d

Please sign in to comment.