cordova-plugin-googlemaps icon indicating copy to clipboard operation
cordova-plugin-googlemaps copied to clipboard

Click on map places

Open mihaibalaban94 opened this issue 9 years ago • 10 comments

Clicking on some places like bus stations, atm, subways don't do anything. I need to know if i can show some infos like what buses are stopping in that stations. Thank you!

mihaibalaban94 avatar Mar 08 '17 13:03 mihaibalaban94

Since Google does not provide the listener for POIs clicking for iOS, I havn't implemented it.

wf9a5m75 avatar Mar 08 '17 14:03 wf9a5m75

But it dosen't work in android too. I clicked on POI but nothing happened, and if i click on my markers it shows some details.

mihaibalaban94 avatar Mar 08 '17 14:03 mihaibalaban94

As I described, I haven't implemented it on both.

wf9a5m75 avatar Mar 08 '17 21:03 wf9a5m75

Ok, thank you!

mihaibalaban94 avatar Mar 09 '17 12:03 mihaibalaban94

@wf9a5m75 Here is docs on 'Listen for click events on POIs' : https://developers.google.com/maps/documentation/ios-sdk/poi Would be nice to have click event returning placeID.

x8x avatar Nov 02 '17 21:11 x8x

If you send as a PR, I really appreciate for your help. Otherwise, please wait when I'm ready.

wf9a5m75 avatar Nov 02 '17 21:11 wf9a5m75

I would, unfortunately I'm not into Cocoa. No hurry, just wanted to point out that google does provide such listener. Thx and keep up the good work!

x8x avatar Nov 02 '17 21:11 x8x

I considered to implement this, but even you get the placeID, you need to obtain the information through Google Places API.

So I decided to start fundraising for creating another plugin of Google Places API. https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1888

I close this thread at once, but you can reply anytime.

wf9a5m75 avatar Nov 14 '17 20:11 wf9a5m75

Hello @wf9a5m75 , I read you are very busy ;-) and wondering what would be the advantage of this new development instead of using https://developers.google.com/places/web-service/intro which works pretty well. I'm not sure to the benefits of using the IOS api for this as it's mostly data transfer. Wouldn't your much appreciated effort be spent more wisely on things like integrating StreetView where native will probably make a big difference? Thank you!

x8x avatar Nov 15 '17 10:11 x8x

- (void)mapView:(GMSMapView *)mapView
    didTapPOIWithPlaceID:(NSString *)placeID
                    name:(NSString *)name
                location:(CLLocationCoordinate2D)location {
  NSLog(@"You tapped %@: %@, %f/%f", name, placeID, location.latitude, location.longitude);
}

Just receiving the placeId is not difficult. However you need to implement the code to get the data from Google Places API using the obtained place ID.

There are three ways: using JavaScript API, using own server, or implment http request in app. Anyway all methods are demelit.

Using JavaScript means you can not the API if the device is offline internet, and slow http request, etc.

Preparing own server is secure way, but you also need to implement the serverside sequrity, pay the server cost, etc.

Implementing Http request to Google Places API directly means you need embed your API key in JavaScript, it's very unsecure. And you can not use the API in offline.

Google provides the native API for Google Places API. I will implement it for this time. Faster than JavaScript, secure network handling, nice UIs. It has many functions. It's almost like creating another this maps plugin. It means it will be hard work easily.

I'm professional software engineer, but nobody pay for me That's why fundraising.


StreetView is another high rated request. If you pay me $1,000USD, I will implement it.

wf9a5m75 avatar Nov 15 '17 15:11 wf9a5m75