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

Latest news

Last at Tue, 6 Dec 2011 18:37:53
Topic: New BlackBerry sample app
See more news »

Icons position VS zoom level

2 replies [Last post]
papagap
User offline. Last seen 1 year 42 weeks ago. Offline
Joined: 09/14/2008

Hello everybody,

the accuracy of my icons' positions strongly depends on the zoom level. For example, an icon in the middle of Tokyo (displayed perfectly when I am "close" to it) appears in China when I set the zoom level to 1 :-)
At first I thought the icon (a .png file) was inadequate but I have the same problem no matter which icon I use.
Are there any suggestions or do I have to live with this inaccuracy?

Thanks in advance, happy to be back to this forum! (still jira, the last time that I posted)

Congratulations for the great work,
Apostolos

jaak
User offline. Last seen 13 hours 9 min ago. Offline
Joined: 06/19/2008

I think the issue is that default icon anchor location is in the center of image. If you use "google-style" markers then it visually seems to be in the bottom-center, and you should define tit there too. To set marker to own defined location (bottom-center) use non-default PlaceIcon, something like following:

 try {
   iconImage =
     Image.createImage("/mymarker.png");
  } catch (IOException e) {}
	
 PlaceIcon placeIcon = new PlaceIcon(iconImage,
   iconImage.getWidth() / 2,
   iconImage.getHeight());

 Place place = new Place(3, "My Place",
  placeMark, new WgsPoint(24.76593650384734,
  59.44530921763007));	

 mapComponent.addPlace(place);

/JaakL

papagap
User offline. Last seen 1 year 42 weeks ago. Offline
Joined: 09/14/2008

Indeed, it had to do with the PlaceIcon contructor. I had already used the overloaded one, as you proposed, but with wrong numerical values for the 2nd and 3d argument.
Your comment pointed to the problem anyway, thanks a lot!