• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Maps of current Location

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ???
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.....
 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
pallavi utukuri
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
well i am using Bitmap format......are zooming capabilities not applicable to Bitmap?
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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??
 
Saloon Keeper
Posts: 28718
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Dushyant Chhetri
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 28718
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic