Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi.
 
What is the best way to come up a Mapping Service using WPF (vb.net), Expression Blend and SQL?
 
I will be creating a Tourist Kiosk, therefore there is an assigned place for it.
 
The system should present a Map and a list of Establishments in town. If an establishment is clicked, the Map will highlight the Establishment and the Kiosk and will present a dotted line in between the Establishment and the kiosk to represent the way.
 
Also, the system will indicate the distance (on how far) the establishment is from the kiosk.
 
What are the best solutions for this, in just using the said programs above?
 
Thanks in advance... Smile | :)
Posted 10-Jul-13 22:48pm
hoyice342
Comments
Silvabolt at 11-Jul-13 16:14pm
   
Keep in mind that the traveler can't just walk in a single line between the kiosk to the establishment. Since you're in .net domain, your probably gonna wanna try out bing maps. Using the api you will have the maps, ability to put markers on the maps (which will be your highlighting feature), the map will be scaled already, there would be automatic path generation for shortest path between the kiosk to the establishment, and a lot of the dirty work will be done.
 
http://www.microsoft.com/maps/developers/web.aspx
 
If you have your own custom map that you want to use, that's probably gonna be a lot more work. In brief, you will need to place your map on the page with another section (dividing the screen) that lists establishments, every time a user clicks on the establishment, retrieve lat and long coordinates, and identify it on the map, trigger a response on the map by making say a label popup, and then you can draw a line objects to map out a path to follow. You'd need to do some kind of scaling to make sure the latitude and longitudes on your map are accurate and you would also need to figure out the algorithms for shortest paths.
 
In both cases, your SQL server needs to store the lat and long coordinates of the establishments and the kiosk itself. If you are doing your own map, you would probably need to store all the intersections between your establishments and kiosk as well.
 
I think it would be something like this, I've never actually worked with any map api directly so I'm not sure if I missed something.
hoyice at 13-Jul-13 11:39am
   
It is a small town, the people in town just walk the whole place. :)
hoyice at 13-Jul-13 11:41am
   
Am I going to use X and Y coordinates for this?
Silvabolt at 11-Jul-13 16:21pm
   
Here is a tutorial I found on bing maps, it uses some thing called WebMatrix to make a website, but the main thing is that you can get a quick glimpse of what you can do with it from the tutorial.
 
http://www.microsoft.com/web/post/using-the-bing-maps-api
 
Not sure about using Google Maps, because I'm pretty sure it isn't built for .net, though there are some 3rd party api extensions for it.
hoyice at 13-Jul-13 11:38am
   
Thank you Silva!!! That is exactly what I'm suppose to do. Out project is not connected in the internet, we cannot use google maps.
 
I guess, we'll be using custom map for this since our application is strictly offline.
 
My question now, is on how will start the project? After i draw the map and everything what will be the next step?
 
Should I turn the establishments into button?
Silvabolt at 13-Jul-13 14:56pm
   
well, first thing is design your WPF app first. This involves primarily two things, designing the map itself (how you're gonna implement it in software), and then the web interface (making the WPF buttons, grids, labels all work).
 
Worry about everything afterwards, because for starters, you just want to show a list of establishments and a map, be able to click on it, and then have a label control show up. That will be the base of your application, and then you can start adding features like mapping a path out, making it look professional and perhaps adding other useful features.
 
By the way, if you are mainly just showing which direction the tourist has to go, there isn't really any need for latitude and longitudes, you just need to highlight a path on the map, and save the distance from predetermined info (getting the distance from google maps for example).
hoyice at 14-Jul-13 21:59pm
   
Thank you sooo much! Now, i am enlightened on which steps would go first.
 
questions:
 
1. How am i able to animate the paths from point kiosk to the clicked establishment? should i use gif? flash? or vb.net allows a feature that may draw a path?
 
THANK YOU AGAIN!!! :)
Silvabolt at 16-Jul-13 10:36am
   
It depends on how you want to animate it, just make the path pop up suddenly, make it fade in, make it slowly draw it out from A to B, etc... and I'm actually not sure what the best way to implement a map is. Don't use flash, but do try exploring other options. In VB.net, you can try to use the System.Drawing class to draw stuff like lines and circles as intersection points.
hoyice at 16-Jul-13 11:02am
   
I've talked to my Project Adviser awhile ago she advised me to do the following:
 
1. To Make a database of the establishments first.
2. To design a a customized map
3. To put objects as point of establishments (PNG file for transparency)
4. When the mouse hover to an establishment to the list, all the objects will turn to invisible except the hovered establishment.
5. When the mouse is hovered to an specified object, the list will show the name of the establishment.
6. when the establishment is clicked, a GIF image of path will pop over the map. (The path has transparent background so that it wont cover the map)
7. I have to create a GIF file of path to each establishment.
 
Is this idea good? or it this idea too difficult to implement?
Silvabolt at 16-Jul-13 12:50pm
   
That's fine I think. The only issue I could see with this is that your images are all static and pre-drawn, which could be a good thing and a bad thing. Good because you separate your graphic work from the coding, and bad because it's probably harder to manage.
 
For example, if you were to have different sized kiosks with different screen sizes, or if you were to open your wpf app on something else it was designed for, your map and path images might go out of the screen. In other words, it's not scaled for the screen size. You can programmatically resize the image I suppose, but with saved images, resizing will most likely decrease your image presentation quality and it isn't easy detecting screen size reliably.
 
Furthermore, you might have to think about the future, because every addition of a new attraction will require you to make a whole new gif image for the paths. What if you want to start drawing paths between establishments for multiple destinations? Hope oyu see what I mean, but if there won't be new establishments, then you don't have to worry about it.
 
One alternative is to use System.Drawing class, with this the lines you draw with it are vectorized and are drawn on runtime. Save your establishments and intersections as relative percentages of x and y from the left corner position of your map image, and then you only need to draw lines on all the paths that you are going to use. By doing this you can reuse the lines if some paths overlap (more managable I think) and even if you use the app elsewhere, it will still be visually the same. Make the lines visible only when they are part of the path from the kiosk to the establishment, and then hide them when they aren't relevant. The downside of this is of course is getting used to the drawing class. It's simple, but to draw things nicely, may take a while to get used to.
 
Here's a link to get you started if you go down this approach.
http://www.dreamincode.net/forums/topic/67275-the-wonders-of-systemdrawinggraphics/
 
Both ways are fine and there may be other solutions, but it really comes down to your requirements. Good luck!
hoyice at 17-Jul-13 5:37am
   
Silvabot, I am so grateful for your words. Thank you for helping me to come up a better solution to my problem. :)
 
I think, I'll stick to the static images plan. I'll just have to declare to my hardware specification (monitor) the required screen size for the kiosk and it's resolution since I'll be creating a fixed application.
 
with regards to new establishment, I'm planning to let the admin of the kiosk to add an establishment (description, and others) plus the admin will draw a path of the establishment and kiosk thru MS paint. It will be saved as an image file without animation though. Meaning, Old establishment will have an animated paths while the new or upcoming establishments will have a still image of a path. It may result to an inconsistent application feature, but thats the only solution in my mind right now.
 
also, i am intersted on the tutorial link that you given, but the language is C# I'll be using vb.net :(
Silvabolt at 17-Jul-13 10:06am
   
No problem! I forgot you were using VB.Net, but I really couldn't find any good VB.NET tutorial for that class. You can always refer to MSDN:
 
http://msdn.microsoft.com/en-us/library/system.drawing.pen.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
 
I think in this case, you can probably search up some graphics software that can make GIFs (there are tons) and then set up a standard procedure to follow in order to make all your paths look and feel the same. Or if anything, have one person on your team be in charge of all the graphics related stuff. I would try to stay away from making inconsistent features.
hoyice at 27-Jul-13 4:10am
   
Hellow Silverio! I am already finished in doing my database and design. I'm having a hard time to display my database (SQL) to wpf datagrid view. I'm using vb.net. what should i do?
Silvabolt at 29-Jul-13 9:20am
   
Hi Hoyice, try this, it uses something known as Entity Framework:
 
http://msdn.microsoft.com/en-us/library/ee340709.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-3
 
You can also google SQL Data client and manually grab your data from DB, but I'd try other methods first.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Maciej Los 305
2 Richard MacCutchan 270
3 Mathew Soji 220
4 BillWoodruff 210
0 OriginalGriff 8,834
1 Sergey Alexandrovich Kryukov 7,477
2 DamithSL 5,689
3 Maciej Los 5,329
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411028.1 | Last Updated 11 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100