Mobile GMaps Home Page
 FAQFAQ    SearchSearch    MemberlistMemberlist    UsergroupsUsergroups   RegisterRegister  
 ProfileProfile    Log in to check your private messagesLog in to check your private messages    Log inLog in 

newbie developer questions

 
Post new topic   Reply to topic   printer-friendly view    MGMaps Forum Index -> Developer Forum
View previous topic :: View next topic  
Author Message
simon
Newbie


Joined: 08 Sep 2009
Posts: 2

Phone Type: Unknown

PostPosted: Tue Sep 08, 2009 4:54 pm    Post subject: newbie developer questions Reply with quote

Hi. I have a bit experience with Java ME and want to try to help a bit with this interesting Project.

I hope someone could help me by answering a few questions:

Code:
public GMapTile(int x, int y, int zoom, int mode) {
    super(x >> getSizeLog(mode), y >> getSizeLog(mode), zoom, mode);
  }


What is being done here to x and y. They represent lat/long and the center of the tile, if I am not mistaken. I guess I lack a bit Theoretical knowledge here. Could someone point me in the right direction?


The URLs for the map tiles are strange, they're different from the official APIs. What's the secret here?


What do you guys think about using a GUI library. LWUIT, which has become part of the recently released JavaME SDK 3.0, would be a good candidate.


Also, I must dish out some critic. Understanding the existing code is challenging, especially with Variable names like Props, NUM_MT, mapTypesTL, ovlMetric, ... . Sure, you get used to it after a while, but it makes it unnecessary hard for new developers.
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Wed Sep 09, 2009 1:02 pm    Post subject: Re: newbie developer questions Reply with quote

simon wrote:
Hi. I have a bit experience with Java ME and want to try to help a bit with this interesting Project.

I hope someone could help me by answering a few questions:

Code:
public GMapTile(int x, int y, int zoom, int mode) {
    super(x >> getSizeLog(mode), y >> getSizeLog(mode), zoom, mode);
  }


What is being done here to x and y. They represent lat/long and the center of the tile, if I am not mistaken. I guess I lack a bit Theoretical knowledge here. Could someone point me in the right direction?

http://en.wikipedia.org/wiki/Mercator_projection
x and y are projected lat/lon values, so that the projected map covers a square of 2^n by 2^n pixels. n=8 for zoom 0 (whole world is 256x256), n=9 for zoom 1 and so on. x>>getSizeLog(mode) essentially divides x and y by 256 to get the number of the map tile.


simon wrote:
The URLs for the map tiles are strange, they're different from the official APIs. What's the secret here?

Umm.. the URLs should be the same as the online maps. Are you talking about google urls (which are commented in the current code)? Maybe those weren't updated.


simon wrote:
What do you guys think about using a GUI library. LWUIT, which has become part of the recently released JavaME SDK 3.0, would be a good candidate.

Both LWUIT and J2MEPolish have problems... lwuit is slow, polish is rather complex to program/customize and it may have device compatibility problems.


simon wrote:
Also, I must dish out some critic. Understanding the existing code is challenging, especially with Variable names like Props, NUM_MT, mapTypesTL, ovlMetric, ... . Sure, you get used to it after a while, but it makes it unnecessary hard for new developers.

You're right. You may want to look at Nutiteq's mgmaps lib sdk too, http://www.nutiteq.com
Back to top
View user's profile Send private message Visit poster's website
simon
Newbie


Joined: 08 Sep 2009
Posts: 2

Phone Type: Unknown

PostPosted: Fri Sep 11, 2009 8:16 am    Post subject: Reply with quote

According to the official documentation http://developer.yahoo.com/maps/rest/V1/, a yahoo static map url should contain latitude and longitude (or ...). You however use it with coordinates from a Mercator map.
Is there some secret documentation for that?


What do you think about http://www.opencellid.org/? Could be used for phones which don't support the Localization API.
Back to top
View user's profile Send private message
Cristian Streng
Founder


Joined: 28 Oct 2005
Posts: 4585

Phone Type: (many)

PostPosted: Fri Sep 11, 2009 8:22 am    Post subject: Reply with quote

simon wrote:
According to the official documentation http://developer.yahoo.com/maps/rest/V1/, a yahoo static map url should contain latitude and longitude (or ...). You however use it with coordinates from a Mercator map.

MGMaps is using map tiles, not yahoo static map. Mercator is the projection used by all these providers (google, MS, yahoo, OSM).

simon wrote:
What do you think about http://www.opencellid.org/? Could be used for phones which don't support the Localization API.

Yes, there are other databases too, this is planned for a future version. The main drawback is the fact that only new phones make cellid information available to java apps.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MGMaps Forum Index -> Developer Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
MGMaps topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group