Hi,
I am trying to use OpenStreetMap with my test-program. It does work with Sun Java Wireless toolkit emulator, but not with a real device. I just get some license notices to log. It tries to connect to lbs.nutiteq.com/licence.php? ... and then it says that vendor name is invalid and map doesn't appear to screen?
I use similar codelines like in hellomap tutorial, like this:
mapItem = new MapItem("map","abcdtrial", this, 300, 150, new WgsPoint(24.764580, 59.437420), 5);
Thanks.
Ok, got it working. Followed these instructions: http://discussion.forum.nokia.com/forum/showthread.php?t=159540&page=2
My code was similar, but I got some more stuff in constructor. I don't know where the problem exactly was :)
Right, this seems to be general issue with Nokia S60 devices: the MIDlet constructor must be as light as possible, otherwise object creation is not done properly and map is not shown. It tends to happen with S60 emulators and real phones. We have not seen it on other devices.
Hi,
I am trying to use OpenStreetMap with my test-program.
I use similar codelines like in "hellomap" tutorial, like this:
mapItem = new MapItem("map","tutorial", this, 300, 150, new WgsPoint(24.764580, 59.437420), 5);
But the map doesn't appear to screen.
Why?
First check that you have added
mapItem.startMapping()
What do you exactly see, and what do you get in the logs?
I Have already add mapItem.startMapping(). but
does not work.
I use this code.
package com.tutorial;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
import com.nutiteq.MapItem;
import com.nutiteq.maps.*;
import com.nutiteq.components.WgsPoint;
import com.nutiteq.controls.ControlKeys;
public class HelloMap
extends MIDlet
implements CommandListener {
private Form mMainForm;
private MapItem mapItem;
public HelloMap() {
mapItem = new MapItem("Map", "tutorial", this, 300, 150, new WgsPoint(24.764580, 59.437420), 12);
mapItem.defineControlKey(ControlKeys.MOVE_UP_KEY, Canvas.KEY_NUM2);
mapItem.defineControlKey(ControlKeys.MOVE_DOWN_KEY, Canvas.KEY_NUM8);
mapItem.defineControlKey(ControlKeys.MOVE_LEFT_KEY, Canvas.KEY_NUM4);
mapItem.defineControlKey(ControlKeys.MOVE_RIGHT_KEY, Canvas.KEY_NUM6);
mapItem.setMap(new CloudMade("af1f43ef62dd5ee68421fb8b25783597",64,1279));
mMainForm = new Form("Hello map");
mMainForm.append(new StringItem(null, "Hello, map!\n"));
mMainForm.append(mapItem);
mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));
mMainForm.setCommandListener(this);
mapItem.startMapping();
}
public void startApp() {
Display.getDisplay(this).setCurrent(mMainForm);
mapItem.startMapping();
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
public void commandAction(Command c, Displayable s) {
notifyDestroyed();
}
}
When I Run the project.
On the screen appears this word.
*********************************
hello_map wants to connect to http://tiles.cloudmade.com/af1f43ef62dd5ee68421fb8b25783597/1279/64/1/12/2330/1202.png using airtime. This may result it charges.
Is it Ok to use airtime?
***************************
Then when I clicked "OK" map does not appears.
In "HelloMap" project map often appears and often
does not appears.
Why?
There were some works in CloudMade which made tiles.cloudmade.com unaccessable for some time. It should be fixed now.
Their official hostname is actually tile.cloudmade.com; it will be fixed in next library update. Meanwhile tiles.cloudmade.com should also work.
I suggest to use network monitor of WTK simulator, then you can see what are exactly requests and responses from server. This helps to identify such problems.
Now licence and vendor stuff is ok, but the map doesn't appear to screen in Nokia 5800 ... :)