Transparent navigation panel for Google Map (MapView)

Tutorials that use the MapActivity. Many using GPS functionality.

Transparent navigation panel for Google Map (MapView)

Postby biosopher » Sat Mar 15, 2008 8:38 pm

A few people were curious how to create a navigation panel for their Google Maps. I've just finished a transparent panel tutorial showing the first step: how to overlay a transparent panel (Linear Layout) onto a MapView.

This is what it looks like after the 1st tutorial:

Image


I'm working on the next tutorial (due later this week) which will show how to navigate between GPS locations using buttons, recognize mouse clicks on the map, and display a popup overlay window much as the web-based Google Maps shows information in an embedded popup window.

Until then, feel free to check it out the first tutorial on transparent panels and let me know what you think: Transparent panel tutorial

Looking forward to seeing more transparent panels out there!

Acopernicus
biosopher
Developer
Developer
 
Posts: 26
Joined: Sat Mar 15, 2008 8:14 pm
Location: San Francisco, California

Top

Postby CHAKYANAS » Tue Mar 18, 2008 5:39 pm

hI , acopernicus
Can u help me ...hw to recognise the mouse click on the Map..? any idea??
I think mouse even is not supported by android(java.awt.)
User avatar
CHAKYANAS
Developer
Developer
 
Posts: 44
Joined: Mon Mar 03, 2008 5:08 am
Location: INDIA

Postby Jesmiatka » Wed Mar 19, 2008 9:16 am

As I said in another post:

Android will not use a mouse, it will use touch screens or people will navigate with the navigation buttons.
There are OnClicklisteners in Android tough, which are used to recognize clicks on buttons, images, whatever you want..
Jesmiatka
Senior Developer
Senior Developer
 
Posts: 164
Joined: Mon Feb 04, 2008 3:37 pm
Location: Netherlands

Postby biosopher » Wed Mar 19, 2008 10:21 pm

Hi CHAKYANAS,

You're in luck...! I just posted a tutorial on my blog that explains exactly how to listen to user 'clicks' on a map. The "clicks" won't actually be mouse clicks but will either by stylus or finger clicks as Jesmiatka suggests.

Please check out my tutorial and let me know if it helps.

Best,
Acopernicus (Anthony)
biosopher
Developer
Developer
 
Posts: 26
Joined: Sat Mar 15, 2008 8:14 pm
Location: San Francisco, California

Hi acopernicus

Postby CHAKYANAS » Thu Mar 20, 2008 7:13 pm

mouse click/or any touch device on map can be recogonised and can be converted in to lat and long...................


Simple code for Mouse click

Rolling Eyes Wink
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public boolean dispatchTouchEvent(MotionEvent ev)
  2.  
  3. {
  4.  
  5. int action = ev.getAction();
  6.  
  7. switch(action)
  8.  
  9. {
  10.  
  11. case MotionEvent.ACTION_UP:
  12.  
  13. int X = (int)ev.getX();
  14.  
  15. int Y = (int)ev.getY();
  16.  
  17. checkInRange(X,Y);
  18.  
  19. if( flag_for_Range==1)
  20.  
  21. screencordToLat(X,Y);
  22.  
  23. break;
  24.  
  25.  
  26.  
  27. }
  28.  
  29.  
  30.  
  31. return false;
  32.  
  33. }  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Thank You .............................

Rolling Eyes Rolling Eyes Wink
User avatar
CHAKYANAS
Developer
Developer
 
Posts: 44
Joined: Mon Mar 03, 2008 5:08 am
Location: INDIA

Top

Return to Map Tutorials

Who is online

Users browsing this forum: No registered users and 2 guests