This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java Micro Edition and the fly likes Maps of current Location Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Maps of current Location" Watch "Maps of current Location" New topic
Author

Maps of current Location

pallavi utukuri
Ranch Hand

Joined: Feb 10, 2004
Posts: 182
hii
I am doing a project in which i need to display geographical MAP of current location/coordinates on the midlet.... so what the best way to do it... is there any alogrithm/procedure where we can map the coordinates to map picxels ..... or any other procedure ? plz help


Thanks,<br />Pallavi
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Is this information consistently changing each second? If it is a picture that might stay for a minute or two, then you can do the Servlet thing where it sends back a Picture, like a PNG, with all the info already on it.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
pallavi utukuri
Ranch Hand

Joined: Feb 10, 2004
Posts: 182
well actually i want the picture to change with every change of coordinates.... soo for that storing pictures in db is not possible.... whats the good way to do that....

another thing is; user enters pincode or name or particualr city and its map should be displayed on the device....soo i thought i will store take a particualr country and store maps of it like state maps and all.... later i would updatate the database..... but my concern is pic files are of large size soo this doesnt sound like good programming to store each map in the db.... sooo ???
Jeff Jetton
Ranch Hand

Joined: Mar 29, 2005
Posts: 71
Originally posted by pallavi utukuri:
well actually i want the picture to change with every change of coordinates.... soo for that storing pictures in db is not possible.... whats the good way to do that....

another thing is; user enters pincode or name or particualr city and its map should be displayed on the device....soo i thought i will store take a particualr country and store maps of it like state maps and all.... later i would updatate the database..... but my concern is pic files are of large size soo this doesnt sound like good programming to store each map in the db.... sooo ???


Yeah, even vectorized maps would take up way more memory that you have available to you if you indend to store any city the user could come up with. You're pretty much going to have to connect to a larger network, with a database of all maps, and fetch the maps from that.

Obviously, if you just fetch a map for where the user is right now, you'd have to requery the network every time the user moved. That's not very practical.

So you'll need to fetch where the user is, and also a sufficiently large portion of the surrounding area. Then the user can move around in this "mini-map" without having to hit the network constantly. If the user begins to move toward the edge of the map you have in memory, you would chop off a portion of the opposite end, and then fetch a section of the map that lies ahead.

You can check out Google Maps to get an idea of what I'm talking about. Notice how it downloads the map in chunks, and only downloads what it needs as you move around.

- Jeff
pallavi utukuri
Ranch Hand

Joined: Feb 10, 2004
Posts: 182
Thanks jeff....for testing i will use maps for a particlar state for example.... soo my database will have maps related to that state only...for the time being...soo your idea i will try to implement... but my main conceern is do i have to go through the exertion to adding these maps in my Db ..... there must b some Db's available which already have all the maps and related data neccessary so that i dont have to worry about updating the map database and just concentrate on developing the application.....
Dave Brown
Ranch Hand

Joined: Mar 08, 2005
Posts: 301
What type of maps are you looking to display ?

Bitmap or Vector ?

You will also have to consider what zooming capabilities you want to give the user as that directly affects the map details needed.


Regards, Dave Brown
SCJP 6 - [url]http://www.dbws.net/[/url] - Check out Grails Forum
pallavi utukuri
Ranch Hand

Joined: Feb 10, 2004
Posts: 182
well i am using Bitmap format......are zooming capabilities not applicable to Bitmap?
Dushyant Chhetri
Ranch Hand

Joined: Oct 28, 2009
Posts: 75
Hi,

we can obtain google maps for a given set of lat lon and zoom depth but we need to register for a google api key form google using your google login details.
Now this simply gives you the static map images .
http://code.google.com/apis/maps/documentation/staticmaps/


However , how can we receive map objects from any of the providers like GOOGLE , YAHOO,...

Any suggestions??
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

Dushyant Chhetri wrote:Hi,
Any suggestions??


Well, here's one: http://faq.javaranch.com/java/DontWakeTheZombies . The original question dates to 2005. Odds are, no one involved cares anymore. That was probably 2 employers back now. It would have been better to ask the question in a new thread.

To get your geographic location, a JME device needs something like the GPS API, which is an optional package not available in all JME devices. To get map data, you can supply your own or reference a map server such as Google Maps or its Yahoo equivalent. Combining the two is left up to you.


Customer surveys are for companies who didn't pay proper attention to begin with.
Dushyant Chhetri
Ranch Hand

Joined: Oct 28, 2009
Posts: 75
Thanks Tim for the small note.
hehe I seriously didn't notice that the post was a Zombie lol..

As you have suggested , I tried to get hold of the webservice from the providers,

I have handled the GPS part rendering to the Lat, Lon by passing it througnh the emulator and atimes even hard coding.

I intend to use this in GPS JavaME devices , (Samsung Star 3G) thus require a dynamic map object on which I can play around.

But I am still not clear on how can I get back a map object from the service provider(ie. Google, Yahoo).
Any light as to a link or doc would be helpful.

I have come across its implementation in Android using Google APIs , However any such alternative for J2ME devices.
Again I want to stress taht I want a Map object to be received on which I can further play around.

Thanks again.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15962
    
  19

Google doesn't work with "map objects". Google Maps is a webserver complex, and they transmit HTTP/HTML. The actual maps are diced into square segments and the client page is fortified with JavaScript that allows smoothly sliding them around, which included making new HTTP img requests (AJAX) when the client's image cache doesn't contain a square it needs.

An open-source equivalent is the ka-Maps! webapp, which pairs nicely with the University of Minnesota mapserver app.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maps of current Location
 
Similar Threads
place components at specific locations?
Storing online player map coordinates in a MMOG
Data v. Reference
I cant find the mistake
New using Android