Community of VE/MapPoint Users and Developers
This is a discussion on Issue with RenderService and rendering a map within the MapPoint Web Service and Virtual Earth forums, part of the Map Forums category; Hello, I've been using a particular method (for educational purposes) the last year or so for rendering a map ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Issue with RenderService and rendering a map I've been using a particular method (for educational purposes) the last year or so for rendering a map from a Route object. Last time I checked this code was about three months or so a go, and it worked perfectly fine. I've been using this code within a Web Service that I coded myself. The idea is to get the info (route description, route distance, route image/map) from the Mappoint Web Service and send it to a J2ME application. Just a couple of days a go I started the Web Service that I had coded myself (after a few months) and now the method that I use for rendering an map from a given Route object seems not to be working. The code is below: public Image getMap(Route rte) { this.connectMappoint(username, password, 2); route = new Route(); route.setCalculatedRepresentation(rte.getCalculate dRepresentation()); Segment[] segments = rte.getItinerary().getSegments().getSegment(); Pushpin startpush = new Pushpin(); Waypoint startway = segments[0].getWaypoint(); startpush.setLatLong(startway.getLocation().getLat Long()); startpush.setLabel(startway.getName()); startpush.setIconName("Car"); startpush.setIconDataSource("MapPoint.Icons"); Pushpin endpush = new Pushpin(); Waypoint endway = segments[1].getWaypoint(); endpush.setLatLong(endway.getLocation().getLatLong ()); endpush.setLabel(endway.getName()); endpush.setIconName("33"); endpush.setIconDataSource("MapPoint.Icons"); pushpins = new ArrayOfPushpin(); pushpins.setPushpin(new Pushpin[] {startpush, endpush}); mapspec = new MapSpecification(); MapOptions mapop = new MapOptions(); mapop.setIsOverviewMap(Boolean.FALSE); mapop.setStyle(MapStyle.DefaultStyle); mapop.setFontSize(MapFontSize.Smaller); mapop.setReturnType(MapReturnType.ReturnImage); mapop.setRouteHighlightColor(RouteHighlightColor.D efaultColor); mapop.setConstructionDelayHighlightColor(RouteHigh lightColor.DefaultColor); mapop.setConstructionClosureHighlightColor(RouteHi ghlightColor.DefaultColor); mapspec.setOptions(mapop); mapspec.setDataSourceName(startway.getLocation().g etDataSourceName()); mview = rte.getItinerary().getView().getByHeightWidth(); try { ImageFormat format = new ImageFormat(); format.setWidth(new Integer(400)); format.setHeight(new Integer(400)); format.setMimeType("image/png"); mapspec.getOptions().setFormat(format); ArrayOfMapView mapviews = new ArrayOfMapView(); mapviews.setMapView(new MapView[] {mview}); mapspec.setViews(mapviews); mapspec.setRoute(route); mapspec.setPushpins(pushpins); ArrayOfMapImage mapimage = renss.getMap(mapspec); MapImage mimage = mapimage.getMapImage(0); mviewreps = mimage.getView(); mview = mviewreps.getByHeightWidth(); image = getToolkit().createImage(mimage.getMimeData().getB its()); return image; } catch(Exception e) { System.out.println("Hier gebeurt de kanker exception " + e); return null; } } Up until now everything was working fine, but with the same code that worked three months a go on the same application I now keep getting an Image object which is 'null'. Anyone here who might be able to help? I am really stuck on this one at the moment. Did the Mappoint RenderService change in the meanwhile by any chance? Help is much appreciated, thanks in advance. |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Map Visitors - Powered by Virtual Earth | This thread | Refback | 09-18-2007 11:21 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Lat and Long issue | hprider | MapPoint Web Service and Virtual Earth | 2 | 07-03-2007 10:16 AM |
| Dataset rendering | Gianmaria | MapPoint 2006/2009 Discussion | 3 | 06-09-2005 02:22 PM |
| java issue | Anonymous | MapPoint 2006/2009 Discussion | 1 | 03-01-2005 05:11 PM |
| vb6 server issue | starbuck | MapPoint 2006/2009 Discussion | 1 | 04-15-2004 10:27 AM |
| Map Rendering | priyands | MapPoint 2006/2009 Discussion | 2 | 01-15-2004 12:05 PM |
Ski Holidays Bulgaria
Ski holidays in Bulgaria offer beautiful scenery, friendly locals and exceptionally low prices. Book at Holiday Hypermarket for great value ski holidays.
Business Travel Agent
Book your business travel with a specialist business travel agent. Travel Counsellors are an award winning travel agent.
Holiday Jamaica
What springs to mind when you hear the word Jamaica? Bob Marley and Rum? Think again. Book a low cost holiday in Jamaica to explore this island for yourself.
St Lucia Holidays
St Lucia holidays offer something for everyone. Enjoyed by families and young couples alike, St Lucia is a great destination. See online!
Spain
Spain is such a diverse country that it has something to offer most holidaymakers. Finding delicious cuisine is no challenge and the shopping ranges from designer boutiques to unknown flea markets. Spain has much to offer.
Cheap Travel
Travel.co.uk is a travel comparison service which makes it easy to search and find your cheap travel options.
Cheap holidays in Cyprus
Stunning coastline! Beautiful beaches! Cheap holidays in Cyprus, available at On The Beach.