Map API

Nutiteq Maps Lib SDK enables developing advanced mobile mapping applications.
Platforms: Android, RIM BlackBerry, Java ME (J2ME)
Download maps API SDK »
Untitled Document

Products

» View demos
» Downloads

Uudised

Viimane: Thu, 15 Mar 2012 14:51:08
Teema: Vabad töökohad pakkuda
Veel uudiseid »

Errors in tutorial with maps_lib_0.10.0

24 replies [Last post]
intelliware
User offline. Last seen 2 years 42 weeks ago. Offline
Joined: 05/06/2009

Hello,
I've got a problem with tutorial code.
import com.nutiteq.utils.LogForm fails, since there is non LogForm class in such location.

Any suggestions?

thanks
giacomo

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

This package (directory) is in the samples/com/nutiteq in the library zip file.

/JaakL

intelliware
User offline. Last seen 2 years 42 weeks ago. Offline
Joined: 05/06/2009

Ok, thanks!

I'm having some problem also with mapItem.showDefaultControlsOnScreen(boolean), i can not find it in mapItem methods.
Also, I can not see any pointer in the device emulator.

intelliware
User offline. Last seen 2 years 42 weeks ago. Offline
Joined: 05/06/2009

I don't know if it is related, but I get the following exception:

java.lang.NullPointerException
at com.nutiteq.BasicMapComponent.e(+20)
at com.nutiteq.BasicMapComponent.resize(+28)
at com.nutiteq.MapItem.paint(+35)
at javax.microedition.lcdui.CustomItem.callPaint(CustomItem.java:1311)
at javax.microedition.lcdui.Form.paintItem(Form.java:2060)
at javax.microedition.lcdui.Form.callPaint(Form.java:1998)
at javax.microedition.lcdui.Display.repaint(+82)
at javax.microedition.lcdui.Display.registerNewCurrent(+235)
at javax.microedition.lcdui.Display.access$700(+6)
at javax.microedition.lcdui.Display$DisplayAccessor.foregroundNotify(+46)
at javax.microedition.lcdui.Display$DisplayManagerImpl.notifyWantsForeground(Display.java:3032)
at javax.microedition.lcdui.Display$DisplayManagerImpl.access$100(Display.java:2455)
at javax.microedition.lcdui.Display.setCurrent(+70)
at hello.MiniHello.startApp(MiniHello.java:71)
at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:44)
at com.sun.midp.midlet.Scheduler.schedule(Scheduler.java:375)
at com.sun.midp.main.Main.runLocalClass(Main.java:477)
at com.sun.midp.main.Main.main(+80)

Map works correctly, with pan and zoom, gps navigation and place icon (but no label). But still no pointer, no place selction and message and no kml visualization...

murali.lancer
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/31/2009

use proxy connection

wtk 2.5.2->edit->preferences->network configurations->and give ur proxy there it will work on the emulator
and one more cause might be there i.e.

setCurrent()method should be after StartMapping() method .try this u wont get exception.
mapItem.startMapping();
Display.getDisplay(this).setCurrent(mMainForm);

but i dont know how to do to work on the device can u tell me if u know

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

Right, the tutorial is a bit out of date. Show zoom controls for pointer-powered (touch) device, or central cursor for non-pointer:

if (hasPointerEvents()) {
map.showDefaultOnScreenZoomControls();
} else {
map.showDefaultCursor();

With KML check if the given URL ends with ? or & like it should. You can see from the network monitor what requests are exactly done, and this gives good hints.

This exception could come if call to some map functions is done before call of startMapping(). I'd need to see the code to comment this more.

/JaakL

intelliware
User offline. Last seen 2 years 42 weeks ago. Offline
Joined: 05/06/2009

I'm using exactly the tutorial code (maybe this exception is launched during the data connection request... )

intelliware
User offline. Last seen 2 years 42 weeks ago. Offline
Joined: 05/06/2009

I0m sorry, but i can not find neither "showDefaultOnScreenZoomControls" nor "showDefaultCursor" in MapItem class!

Only showZoomLevelIndicator(boolean)...

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

This exception can be actually safely ignored. It happens during asking networking permissions, graphics is not yet available, but library tries to draw it.

/JaakL

intelliware
User offline. Last seen 2 years 42 weeks ago. Offline
Joined: 05/06/2009

Ok, I supposed so.

What about the other problem, i.e. I can not find neither "showDefaultOnScreenZoomControls" nor "showDefaultCursor" in MapItem class!

Only showZoomLevelIndicator(boolean)...

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

Right, correct code would be:

if (hasPointerEvents()) {
map.setOnScreenZoomControls(new OnScreenZoomControls(Utils.createImage(OnScreenZoomControls.DEFAULT_ZOOM_IMAGE)));
} else {
map.setCursor(new DefaultCursor(0xFFFF0000));
}

/JaakL

murali.lancer
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/31/2009

hi ,i got exactly same doubt .
java.lang.NullPointerException
at com.nutiteq.BasicMapComponent.l(+22)
at com.nutiteq.BasicMapComponent.resize(+28)
at com.nutiteq.MapItem.paint(+35)
at javax.microedition.lcdui.CustomItem.callPaint(+51)
at javax.microedition.lcdui.Form.paintItem(+192)
at javax.microedition.lcdui.Form.callPaint(+123)
at javax.microedition.lcdui.Display.repaint(+82)
at javax.microedition.lcdui.Display.registerNewCurrent(+235)
at javax.microedition.lcdui.Display.access$700(+6)
at javax.microedition.lcdui.Display$DisplayAccessor.foregroundNotify(+46)
at javax.microedition.lcdui.Display$DisplayManagerImpl.notifyWantsForeground(+152)
at javax.microedition.lcdui.Display$DisplayManagerImpl.access$100(+6)
at javax.microedition.lcdui.Display.setCurrent(+70)
at com.tutorial.HelloMap.startApp(+68)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)

iam not understanding how to avoid these errors can u anyone tell me briefly pls
tx

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

This exception should not come with latest version (1.0.0) anymore. If it does, please let me know. Anyway, it can be just ignored.

/JaakL

murali.lancer
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/31/2009

hi .i solved my pbm .but i got another pbm i.e.

hello map application was executed in the emulator ,but when i was tried in the mobile, maps were not displaying and even error also not coming.
i has given MGMaps api key ,but with any key also it is working in the emulator .
so to exeute my application tell me the solution .
and finally i was changed the co ordinates of the place then maps r not displaying in the emulator .

for all these tell me the solution .

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

If you run application in emulator then server does not check license data. If the issue is there, you should see red text with license error message.

I would need to your code to help with it, and also what is your device.

/JaakL

murali.lancer
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/31/2009

k .but that is not giving any error (red mark)
in the map place nothing was displayed.text has displayed.
N73 my device
and my code is

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);
mMainForm = new Form("Hello map");
}
public void startApp()
{
mMainForm.append(new StringItem(null, "Hello, map!\n"));
mMainForm.append(mapItem);
mMainForm.addCommand(new Command("Exit", Command.EXIT, 0));
mMainForm.setCommandListener(this);
Display.getDisplay(this).setCurrent(mMainForm); mapItem.startMapping();
}
public void pauseApp()
{}
public void destroyApp(boolean unconditional)
{}
public void commandAction(Command c, Displayable s)
{
notifyDestroyed();
}
}

in the tutorial (apikey) place i has given my generated api key (trial version).

i have executed this application susccesfully with emulator .but with device maps r not displayin.give me the solution

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

It looks like your phone cannot get HTTP connection. It could be missing configuration in phone, or some operator limitation. Do you have other j2me on-line applications running fine in the same phone?

/JaakL

murali.lancer
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 07/31/2009

and tell me the procedure how to get licenced data

nagkumar
User offline. Last seen 2 years 41 weeks ago. Offline
Joined: 08/04/2009

jaak, would it be possible have a demo licence.. if yes, is it manditory to have a server ourself.. Can the licence allow direct request from mobile to your server.

I understand gmaps, does not allow direct access but supports indirect.

Regards,
Nagendra

Raja Nagendra Kumar,
C.T.O
www.tejasoft.com
Nagendra.Raja@TejaSoft.com

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

Without own server we have following buit-in supported options:

a) for free, but without any service guarantee: use openstreetmap.org tiles. This is the default map source for the library.
b) with service guarantee (SLA): use CloudMade map server. These are for free, and supposedly also remain free but advertisements could be added someday. Data is the same as with Openstreetmap.
c) with SLA and with yearly fee: Navteq MapTP.
d) I know that Microsoft has made agreement with some mobile service providers and allow to use their tiles. You should contact them directly.

http://www.nutiteq.com/content/maps page has samples of these sources, and also some others. We have contacts with all map providers there and could help you with these.

Also other 3rd party map services can be added. Depending on their API it may require some small development in Lib SDK, but usually this is not needed.

/JaakL

kursakiichigo
User offline. Last seen 2 years 12 weeks ago. Offline
Joined: 09/15/2009

hello , i have downloaded the new .jar map lib 0.10 , and i am having this exception when i run the HelloMap : java.lang.NoClassDefFoundError: com/nutiteq/MapItem
at com.sun.midp.midlet.MIDletState.createMIDlet(+29)
at com.sun.midp.midlet.Scheduler.schedule(+52)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)
, i tried many things but it don't work though .
Help is appreciated .

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

In Eclipse you have to make sure that library .jar file is included also in the final package. It looks like it is not, and at least with Eclipse by default it is not.

In Eclipse: Right-click on project > Build Path > Configure Build path > Order and Export tab > select "maps-lib_xx.jar" choise > OK.

With other IDEs maybe something similar is needed.

/JaakL

kursakiichigo
User offline. Last seen 2 years 12 weeks ago. Offline
Joined: 09/15/2009

hello again, sorry but i did that , and i still have the same problem besides when i create a package after doing that , i get an "error occurred during the build " problem and i am unable to create the package .

jaak
User offline. Last seen 1 day 22 hours ago. Offline
Joined: 06/19/2008

Sometimes Eclipse projects just get broken. It maybe helps if you create new J2ME project, add library to it, and your classes.

/JaakL