Community of VE/MapPoint Users and Developers
This is a discussion on findAdressResults with Java pb within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi everybody, I'm working on a java application using Mappoint and I have a problem with the "findAdressResults" method here ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| findAdressResults with Java pb I'm working on a java application using Mappoint and I have a problem with the "findAdressResults" method here is the code i wrote, but I don't know how to retrieve the location result: Code:
FindResults fr;
Integer geousa=new Integer(MNPA83.GeoCountry.geoCountryUnitedStates);
Location objLoc1;
Variant index =new Variant(com.borland.dx.dataset.Variant.INT);
index.setInt(1);
fr=objMap.findAddressResults("359 WABASH AVE","BUFFALO"," ","NY","14217",geousa);
int nbfound=fr.getCount();
objLoc1=(Location)fr.getItem(index);
Please help me to correct the Error if you can, Thanks in advance. |
| |||
| Re: findAdressResults with Java pb
Hi, All items of the collection are not nececarly Location objects. The collection can have other types of object in it also. Possible that is the course for the exception. So you have to check first the type of the item before typecasting it.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: findAdressResults with Java pb
Thanks Wilfried for your reply, The result's type is "stdobjref" so to solve the pb I replaced the Cast instruction by the following: Code: objLoc1= new Location(fr.getItem(index)); If you have any other Solution please let me know. Thanks again. |
| |||
| Re: findAdressResults with Java pb
Hi, Yes will sure work if the returned item is a Location object, but what if it is a Pushpin or other object, then it will generate an exception. I'm no Java specialist but maybe first store it in a new object, this will always work, then get the class of it and if it is a Location then I think you can typecast it. Something like this: Object o = new Object(fr.getItem(index)); o.getClass() or o.isInstance() or o.getClass.getName() I'm not sure if this will get you further.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Using MapPoint In Delphi - MapPoint Articles - MP2K Magazine | This thread | Refback | 04-22-2007 11:56 AM | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 04-17-2007 01:59 PM | |
| MapPoint Gets New General Manager - MapPoint News - MP2K Magazine | This thread | Refback | 04-14-2007 09:02 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mappoint java support | Anonymous | MapPoint Web Service and Virtual Earth | 7 | 02-20-2007 07:22 AM |
| mappoint cd development in java? | nprimex1 | MapPoint 2006/2009 Discussion | 2 | 03-23-2006 11:18 AM |
| java issue | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-01-2005 05:11 PM |
| compatibility java and asp | Anonymous | MapPoint 2006/2009 Discussion | 3 | 04-19-2004 11:03 AM |
| something like mappoint, but for java... | Joeba | MapPoint 2006/2009 Discussion | 2 | 12-03-2002 09:14 AM |
Canada Ski Holidays
Canada is rich in culture and heritage. It boasts over 41 national parks diverse in wildlife and spectacular scenery. Canada ski holidays offer a truly remarkable ski holiday destination.
Online Travel Agent Uk
UK's Best Travel Agent at the Guardian Unlimited travel awards. We have UK Online Travel Agents free to help with your travel.
Flight to Canada
Book a flight to Canada to explore one of the most exciting travel destinations in the world. There are loads of interesting cities but some even more impressive natural beauty.
Cuba Holidays
Cuba holidays offer an exciting cultural and wonderful culinary experience. Book with The Holiday Place for a great deal.
Cheap Greece Holidays
For cheap Greece holidays make sure you know when to book and who to book with. Visit ulookubook.com to get help with doing both of those things. Why not time your visit with a Greek festival?
Cheap family holidays
To plan cheap family holidays, use Travel.co.uk to explore all the delightful possibilities that there are.
Sharm Holidays
See beautiful Egyptian sites! Info on Sharm holidays, only at On The Beach.