Rubinho
05-30-2007, 03:29 AM
Hi,
I have a French map (ptm extenstion). This map has all our 50 territories inside colorized.
What i want to do in my application is when i select a city (by postal code), i want to open my file and show that city. (if possible marked in other color)
How can i do this ?
I can already open my ptm file to see ech territory, but i need to know how i can mark the specified city and if poosible zoom to the city also.
I Use VB.Net, but the answer doesn't really has to be in vb.net
Thx to all
Wilfried
05-30-2007, 11:53 AM
Hi,
I'm not sure I understeand correcly, but if I do, then use SelectionChange event to see what is selected. If it is some city, then load the *.ptm file. Somewhere you have to keep a table of cities with the coordinates and eventually the zoom factor. Use that table to go to the city and zoom to the level you need.
Rubinho
05-31-2007, 01:20 AM
Hi,
I'm not sure I understeand correcly, but if I do, then use SelectionChange event to see what is selected. If it is some city, then load the *.ptm file. Somewhere you have to keep a table of cities with the coordinates and eventually the zoom factor. Use that table to go to the city and zoom to the level you need.
Hi,
Thx for the help, i already spent a lot time on it, and found a good solution/alternative
With FindAdress, i searched the city, placed a pushpin on it and zoomed to the destination.
I still have my old territories, so the stuff works
nbhatnagar_map
05-31-2007, 06:48 AM
Hi Rubinho,
I am facing the same problem. I would greatly appreciate if you can elaborate on your solution or if possible share some portion of the code
thanks in advance,
Nitin
Rubinho
05-31-2007, 06:54 AM
Hi Rubinho,
I am facing the same problem. I would greatly appreciate if you can elaborate on your solution or if possible share some portion of the code
thanks in advance,
Nitin
Hi,
This is my code:
Try
mpKaart.OpenMap("c:\someExistingMap.ptm")
Dim map As MapPoint.Map
map = mpKaart.ActiveMap
Dim loc As MapPoint.Location
Dim rs As MapPoint.FindResults
Dim objPin As MapPoint.Pushpin
loc = map.FindAddressResults(,"SomeCity",,"","Some Postal Code","France")(1)
objPin = mpKaart.ActiveMap.AddPushpin(loc, "Additional Text")
objPin.BalloonState = MapPoint.GeoBalloonState.geoDisplayNone
objPin.Symbol = 79
objPin.Highlight = True
map.Location = loc
map.ZoomIn()
Catch ex As Exception
MsgBox(ex.Message)
EndTry
If you have any questions, just ask