MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Issue with RenderService and rendering a map

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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint Web Service and Virtual Earth

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 09-18-2007
Junior Member
White Belt
 
Join Date: Sep 2007
Posts: 1
Issue with RenderService and rendering a map

Hello,

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/issue-renderservice-rendering-map-6387.html

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

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


All times are GMT -5. The time now is 08:34 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5
MP2K Magazine
Visitor Map

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.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51