File tree Expand file tree Collapse file tree
android/plugin/google/maps Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?xml version =' 1.0' encoding =' utf-8' ?>
2- <plugin id =" plugin.google.maps" version =" 1.3.0 " xmlns =" http://apache.org/cordova/ns/plugins/1.0" xmlns : android =" http://schemas.android.com/apk/res/android" >
2+ <plugin id =" plugin.google.maps" version =" 1.3.1 " xmlns =" http://apache.org/cordova/ns/plugins/1.0" xmlns : android =" http://schemas.android.com/apk/res/android" >
33 <name >phonegap-googlemaps-plugin</name >
44 <js-module name =" phonegap-googlemaps-plugin" src =" www/googlemaps-cdv-plugin.js" >
55 <clobbers target =" plugin.google.maps" />
1717 <engines >
1818 <engine name =" cordova" version =" >=3.5.0" />
1919 </engines >
20-
21- <dependency id =" plugin.http.request" />
22-
20+
2321 <!-- android -->
2422 <platform name =" android" >
2523 <preference name =" API_KEY_FOR_ANDROID" />
Original file line number Diff line number Diff line change 1717import org .json .JSONException ;
1818import org .json .JSONObject ;
1919
20- import plugin .http .request .HttpRequest ;
2120import android .annotation .SuppressLint ;
2221import android .annotation .TargetApi ;
2322import android .app .Activity ;
@@ -151,6 +150,8 @@ public void run() {
151150
152151 try {
153152
153+ /*
154+
154155 JSONArray params = new JSONArray();
155156 params.put("get");
156157 params.put("http://plugins.cordova.io/api/plugin.google.maps");
@@ -172,6 +173,7 @@ public void sendPluginResult(PluginResult pluginResult) {
172173 }
173174 }
174175 });
176+ */
175177 } catch (Exception e ) {}
176178 }
177179 });
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ -(void)launchNavigation:(CDVInvokedUrlCommand *)command
4545 [NSString stringWithFormat: @" comgooglemaps-x-callback://?%@ " , [params componentsJoinedByString: @" &" ], nil ];
4646 } else {
4747 directionsRequest =
48- [NSString stringWithFormat: @" http ://maps.apple.com/?saddr=%@ &daddr=%@ " ,
48+ [NSString stringWithFormat: @" https ://maps.apple.com/?saddr=%@ &daddr=%@ " ,
4949 from, to, nil ];
5050 }
5151 NSURL *directionsURL = [NSURL URLWithString: directionsRequest];
Original file line number Diff line number Diff line change @@ -129,9 +129,8 @@ - (void)_setImage:(GMSGroundOverlay *)layer urlStr:(NSString *)urlStr completion
129129 return ;
130130 }
131131
132-
133- range = [urlStr rangeOfString: @" http://" ];
134- if (range.location == NSNotFound ) {
132+ NSURL *isUrl = [NSURL URLWithString: urlStr];
133+ if (!isUrl || !isUrl.scheme || isUrl.host ) {
135134 layer.icon = [UIImage imageNamed: urlStr];
136135 [self .mapCtrl.overlayManager setObject: layer.icon forKey: id ];
137136 completionHandler (nil );
Original file line number Diff line number Diff line change @@ -68,8 +68,8 @@ -(void)createKmlOverlay:(CDVInvokedUrlCommand *)command
6868 }
6969
7070
71- range = [urlStr rangeOfString: @" http:// " ];
72- if (range. location == NSNotFound ) {
71+ NSURL *isUrl = [NSURL URLWithString: urlStr ];
72+ if (!isUrl || !isUrl. scheme || !isUrl. host ) {
7373 tbxml = [tbxml initWithXMLFile: urlStr error: &error];
7474 } else {
7575 NSURLRequest *req = [NSURLRequest requestWithURL: [NSURL URLWithString: urlStr]];
You can’t perform that action at this time.
0 commit comments