1 (edited by mikejm 2021-11-22 06:17:16)

Topic: How to use Online Maps for setting up "Meetups" in my social app?

I am developing an Android/iPhone mobile app with a social component where people can suggest "Meetups" at given locations.

I have the Online Maps asset running from the Wizard. However, I am not sure how to make it do the things I need. I can see from the Atlas that likely all these things should be possible. But I'm not sure where to start and I would appreciate your feedback.

I am not sure if the methodology will be very different from one option to another. Eg. Here.com vs. ArcGIS. The costs of these services may make one more preferable to another in the long run. But for now I just want to get it running. Here.com seems like a good service from my research so would be a good option perhaps if you think it makes sense for my needs. I am open to suggestion as you likely know more about these maps than I do.

The functions I need will all only involve basic normal UI RawImage/Image 2D street maps. These are:

_________________________

1) OPEN MAP TO USER'S LOCATION:

If you go to Google Maps in a web browser, it will initially load a street map screen of your area based on GPS showing roughly a 10-20 km radius. This is exactly how I want my map to first show when it loads, based on the user's GPS location.

2) SEARCH FOR AND SELECT A LOCATION/ADDRESS NEAR USER'S LOCATION:

If you next type into the input field of Google Maps "Starbucks" and search, it will then show markers for all the hits that come up within a certain radius. Or if you search more specifically like "Starbucks, City" it will show those there. You can then click any marker to see more details. Similarly, I need  my map to be searchable in this manner from a Unity input field (ie. string input passed into to the map by a function).

The user must then be able to click one of the markers to select it. Once selected, I would need to pull the address/etc out from that marker/location into a string again for a Unity variable/field to display and store below the map like "Selected Location: Starbucks, 804 Broadway Avenue, City."

Once this user has done searching and selecting the meetup location, they could hit "send/submit" to store and send the address string to another user.

3) DRAW ROUTE FROM USER'S LOCATION TO SELECTED LOCATION:

The next user is then receiving this. When they open the meetup suggestion, it should show the selected location on the map. Ie. Zoom to the map on "Starbucks, 804 Broadway Avenue, City" with a marker there.

I would also like to have a button that says "Show Route." If this second user clicks it, it will draw a route from their current location (GPS) to this meetup location, so they can see how far it is and how it would be to get there.

_________________________

Is this usage a challenging feat for Online Maps? Would it be easier or harder with one particular map service (like Nokia vs ARCGis)? How would I go about these mapping tasks?

Lastly, in a minor sense, I am also wondering if there is some way to control the size of the streets/labels within the map view. Currently it makes everything very small (tiny street names) and I would like them bigger. Ie. When I zoom in a level, before it redraws, everything looks good. Then it redraws and all the labels and details are tiny again. Can this be controlled?

Thanks for such a great asset. Even though I don't know how to control it exactly yet, it's very impressive. It must have been a lot of work to get it running. I hope your business is doing well in return.

Thanks.

Re: How to use Online Maps for setting up "Meetups" in my social app?

Hello.

1. Add Online Maps Location Service Component.

2. Use Google Places Nearby Search or equivalent services to find places.
An example is in the atlas.
You can use tiles and services in any combination.

3. Use Google Directions API or equivalent services to find a route and draw it using Drawing API.
Examples are in the atlas.

4. In general, you cannot resize labels, because they are drawn in tile textures on the provider side.
Currently, only Mapbox allows you to resize labels in styles.
For the labels to be the correct size, you must resize the map to fit the screen.
If you want a full screen map, just add Online Maps Adjust To Screen component.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

3 (edited by mikejm 2021-11-23 08:09:45)

Re: How to use Online Maps for setting up "Meetups" in my social app?

Thanks Alex. That was helpful. The system is remarkably easy to use from the examples posted.

To solve the zooming issue (map  labels too small on screen) I made the map bigger and then just put a mask over top to restrict its display size the screen space needed. That was easy.

I think I will have to use Google Maps for my purpose. I followed the tutorials to create a marker at the user's GPS location and open the map zoomed to this location.

I can also see in the Atlas there are instructions for how to submit a "nearby" search and add the markers to the screen for results. I will need to set up a Google API key for this I think.

The only other challenge I then have for now is I notice Google Maps Terrain adds and draws its own markers all over the map when you zoom in (eg. For gas stations, schools, restaurants, etc.). The problem in this usage is you can't click any of these from Unity as they are just in the map picture itself. This would be confusing for users.

Thus I need either one of two solutions:

1) Block Google Maps from creating automatic markers on the texture.

2) Block Google Maps from creating automatic markers on the texture, but grab the name/location from the Google API for what markers should be there from Google Maps so I can create my own to replace theirs.

Are either or both possible? If I could take an array of all the markers they have tried to add to the texture on each screen and automatically draw them with tooltips that would be ideal because then I can have all the same location finding/selecting function as they have in Google Maps. I could make them clickable to select in Unity.

What do you think? Thanks.

Re: How to use Online Maps for setting up "Meetups" in my social app?

You can block markers by creating a custom style using Snazzy Maps or equivalent.
Read "Styled Google Maps" documentation section to learn how to use this in Online Maps.
You can get information about a marker using Google Geocoding API (Reverse Geocoding).

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.