Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on MapPoint Control from Visual C++ : Getting a postal code within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi everyone: I want the postal code of a region on which the user clicks to be returned. So I ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| MapPoint Control from Visual C++ : Getting a postal code I want the postal code of a region on which the user clicks to be returned. So I use the 'OnBeforeClickControl1()' event handler and what I do is the following: void CMapPointTest1View::OnBeforeClickControl1(long Button, long Shift, long X, long Y, BOOL FAR* Cancel) { m_location=m_map.XYToLocation(X,Y); m_location.GoTo(); m_location.Select(); CStreetAddress sa = m_location.GetStreetAddress(); CString postalcode=sa.GetPostalCode(); } m_location is a CLocation object, m_map is a CMap1 object. But the CString 'postalcode' is empty! WHY ??? |
| |||
|
Hi geouser, When you click somewhere in your region, you have to check if it is a GOOD ADDRESS. If not, you have to look for the NEAREST one. Thus, you can get the street, the postal code, and so on. Look in this forum for the REVERSE GEOCODING discussion. I remember, I've seen here a good article about getting nearest address. Hope this will help Ciao |
| |||
|
exactly! From what I know so far it should be a loop searching for good results. And it seems to work. But even the good locations do not return a postal code from the CFindResults object. Anyway: Good location or not, it should be possible to have the postal code or - better - the FIPS code for any spot in the US. If you click somewhere in the desert of Nevada with no popular place around, there must be a FIPS code for that region..... geouser |
| |||
|
Hi: Federal Information Processing Standard (FIPS) codes for counties used by the U. S. Census Bureau, see http://www.census.gov/geo/www/fips/f...a/national.txt every county has one. IM searching for the possibility to have the county returned after the user clicks on the map. geouser |
![]() |
| Tags |
| code, control, mappoint, postal, visual |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with MapPoint control redraw in Visual c++ | Anonymous | MapPoint 2006/2009 Discussion | 2 | 11-21-2004 04:04 PM |
| Control of MapPoint 2002 using Visual Basic .Net | DogsWorld | MapPoint 2006/2009 Discussion | 1 | 02-26-2004 10:53 PM |
| MapPoint 2004-Create Territories Using Full Cdn Postal Code | wkcarreg | MapPoint 2006/2009 Discussion | 1 | 01-30-2004 11:46 AM |
| MapPoint 2002 ActiveX control and Visual Studio .NET 2003 | chulaka | MapPoint 2006/2009 Discussion | 1 | 09-30-2003 10:35 AM |
| How to get a postal code | huelsi | MapPoint 2006/2009 Discussion | 0 | 07-27-2003 12:00 PM |
Florida Holiday
Book your Florida holiday through UlookUbook and save cash!
Nightlife London
Looking for Nightlife in London? Look no further, and click here!