Selection on a Map

Good morning, I'm looking on some advice as to how to approach this project I'm working on, it's just for fun, attempting to develop an app for the first time.

I'm currently attempting to do something along the lines of where I put an image of the world or a continent on the background. And then when the user selects a country or maybe province (if it's within a country), then have a little pop-up appear (the same type as right clicking a mouse) with information about that location they clicked: population, area, flag, name, etc. The image will also probably be too large for 1 screen, so drag and zoom would have to be implemented as well.

What I'm struggling with, is how to make the image interactive like this. Countries are not nice squares or circles... I can use a blank image with just outlines if it makes easier. Any suggestions on how to approach this? I'm just not sure how to create these boundaries and behave differently depending the coordinate of where they tapped.

Thank you.


  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    First - stop thinking you're going to work with images. That just makes life hard because of all the problems you just posed.

    Pick a map provider. You're going to want to display a Map control. All the different providers have functions built in for you to use. For example they have some flavor of MapClicktoGPSpoint function built into their map control. They don't expect all 100,000 developers using their map to all work out their own code for this.

    Once you have a GPS point, you can then use their API to query that point for things like: GetCountry.... GetTimeZone... etc.

    attempting to develop an app for the first time.

    Aiming big can be good. Working beyond your comfort zone can help stretch your skills. But something like this might be a little too much for a first app. You'll have to decide. But it takes a while just learn good UI design... learn good interaction with a person... learn saving local preferences... etc. - If this project starts too feel like too much don't be afraid to back down and work on something a little smaller to learn the basics. You can then return to this.

  • MatyBMatyB Member ✭✭

    That's good to know, I thought this was going to be something simple, a turn-based game. I have no time restrictions or time frame, as long as I keep moving forward, I'm happy, but I'll take your advice if it's too complicated.

    That kind of helps, however I guess I should of been more specific. I'm trying to create a game and I can't use GPS locations like you mentioned. This game uses a map of Europe as an outline but inside the map is divided into strategic territories. How would you approach this? Each territory will have a set of properties, which player it belongs to, is there anything stationed there, etc.

    Below is a link to a map of the typical game play. Ignore the bold lines, they just outline where each player starts, but once the game begins anything can happen.


    PS. There are also other versions of the game that use a different map, one of the world, a medieval map, etc. I'm not trying to create these, not till I have a finished product, however, I am trying to keep this in mind.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Ok. Fictional map. Much different than when I thought you meant a real world map - which is a popular need in today's mobile market.

    Games are amongst the hardest softwares to write. Probably not the first thing you want to start with as a learning project for fun. Your first post said this was just for fun. Then your second post said

    I have no time restrictions or time frame, as long as I keep moving forward,

    Which makes it sound like an assignment.

  • MatyBMatyB Member ✭✭

    Is Xamarin the right tool for something that I'm trying to create?

    I'm not sure how you get assignment out of that. I'd just like to keep learning and progressing. I don't want to be stuck, like at this map thing, for weeks without making any progress. Don't want to loose morale and give up.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Xamarin is used to create games. Is it the right tool for what you have in mind? Well... based on a paragraph or two of description... sure, no reason not to.

  • MatyBMatyB Member ✭✭

    How would you approach this if it were you? Fictional map, boundaries are't very nice, and you have to know which territory the user tapped.

Sign In or Register to comment.