07-01-2010 05:27 AM
you should post every new problem in new thread, so can other programmers can find a solution, or even suggest a solution.
08-09-2010 02:05 AM
Hello Mr Jitendra Sharma.
I tried using your MultiMapField class but i am not able to resolve InfoTraceRoute. Is it your Custom class. If so can you please share it too.
08-31-2010 09:13 AM
Hi Sir
plz send InfoTraceRoute class in customMapField.
Thanks & Regards
A.suman
05-04-2011 11:33 PM
Hello sir,
I want to get the lat & long clicking on map.
i write below code in custmo map field but i cant get the value of it.
I tried by debugging code but the debugger not go in the method.
so please help me to come out from this issue.
Thanks & Regards
![]()
05-05-2011 12:27 AM
Hello Mr. Jitendra Sharma Sir,
can you please give me a favour ?
can you please send your InfoTraceRoute.java custom class mail me on mlnmodi@gmail.com?
Thanks & Regards
05-23-2011 01:18 AM
Hello Sir,
I want to get the latitude & longitude of map.
Now I click on map any where i get the center of map's latitude & longitude.
But I want to get the latitude & longitude of map where i clicked on map.
So please any one has any idea please help me to solve my issue.
Thanks & Regards
07-01-2011 01:32 AM
Hi ,
I have been trying to implement pretty much the same thing. But i also want to include PAN ans ZOOM options through trackball and keypad respectively.
I have tried the following
public
boolean navigationMovement(int dx, int dy, int status, inttime)
{
boolean b = false;
dx = dx << 3;
dy = dy << 3;
// Allows smoother panning on the map.if (Trackball.isSupported())
{
// Adjust the filter.
getScreen().setTrackballFilter(Trackball.
FILTER_NO_TIME_WINDOW | Trackball.FILTER_ACCELERATION);
b=
true;
}
mapField.mf.move(dx*10, dy*10);
invalidate();
// Delegates this task to the map instance.returnb;
}
protectedboolean keyDown(int keycode, inttime) {
int key=Keypad.key(keycode);
//String keyname= String.valueOf(Keypad.map(key, status));
String keyC=Integer.toString(key);
System.
out.println("********************************* key pressed"+key);
System.
out.println("********************************* key pressed to string"+keyC);
returnsuper.keyDown(keycode, time);
}
publicboolean keyChar(char key, int status, inttime)
{
System.
out.println("inside keychar");
boolean retval = false;
int zoom=mapField.mf.getZoom();
if(key== 'o'||key== 'O')
{
zoom=zoom-3;
mapField.mf.setZoom(zoom);
retval = true;
}
return
retval;
}
I have over ridden these methods inside the place where I am calling the multimap manager.
Also this is the implementation of my multimap manager.Please tell me if I am doing anythin wrong.As I m unable to view certain location s and also zoom through touch event also doe snot work all the time.
import javax.microedition.location.Coordinates;
import net.rim.device.api.lbs.MapField;
import net.rim.device.api.system.Bitmap;
import net.rim.device.api.ui.Graphics;
import net.rim.device.api.ui.XYPoint;
import net.rim.device.api.ui.component.BitmapField;
import net.rim.device.api.ui.container.AbsoluteFieldManag
import net.rim.device.api.util.Arrays;
public class MultiMapLocManager extends AbsoluteFieldManager{
Coordinates[] mPoints = new Coordinates[0];
Bitmap mPoint;
public MapField mapField;
boolean bitmapInLocationFlag[];
BitmapField field[];
int coordinatedCount;
public MultiMapLocManager(int count,Bitmap mPoint) {
mapField=new MapField();
this.mPoint=mPoint;
this.coordinatedCount=count;
add(mapField);
bitmapInLocationFlag=new boolean[count];
field=new BitmapField[count];
for(int i=0;i<count;i++){
field[i]=new BitmapField(Bitmap.getBitmapResource("red-pin.png"
bitmapInLocationFlag[i]=false;
}
}
public void addCoordinates(Coordinates coordinates) {
Arrays.add(mPoints, coordinates);
zoomToFitPoints();
}
protected void zoomToFitPoints() {
// zoom to max
mapField.setZoom(mapField.getMaxZoom());
// get pixels of all points
int minLeft = getWidth();
int minUp = getHeight();
int maxRight = 0;
int maxDown = 0;
Coordinates minLeftCoordinates = null;
Coordinates minUpCoordinates = null;
Coordinates maxRightCoordinates = null;
Coordinates maxDownCoordinates = null;
for (int i = 0; i < mPoints.length; i++) {
XYPoint point = new XYPoint();
mapField.convertWorldToField(mPoints[i], point);
if (point.x <= minLeft) {
minLeft = point.x;
minLeftCoordinates = mPoints[i];
}
if (point.x >= maxRight) {
maxRight = point.x;
maxRightCoordinates = mPoints[i];
}
if (point.y <= minUp) {
minUp = point.y;
minUpCoordinates = mPoints[i];
}
if (point.y >= maxDown) {
maxDown = point.y;
maxDownCoordinates = mPoints[i];
}
}
double moveToLat = maxDownCoordinates.getLatitude()
+ (minUpCoordinates.getLatitude() - maxDownCoordinates
.getLatitude()) / 2;
double moveToLong = minLeftCoordinates.getLongitude()
+ (maxRightCoordinates.getLongitude() - minLeftCoordinates
.getLongitude()) / 2;
Coordinates moveTo = new Coordinates(moveToLat, moveToLong, 0);
mapField.moveTo(moveTo);
// zoom to min left up, max right down pixels + 1
int zoom = mapField.getZoom();
boolean outOfBounds = false;
while (!outOfBounds && zoom > mapField.getMinZoom()) {
zoom--;
mapField.setZoom(zoom);
XYPoint point = new XYPoint();
try {
mapField.convertWorldToField(minLeftCoordinate
if (point.x < 0)
outOfBounds = true;
mapField.convertWorldToField(minUpCoordinates, point);
if (point.y < 0)
outOfBounds = true;
mapField.convertWorldToField(maxRightCoordinat
if (point.x > getWidth())
outOfBounds = true;
mapField.convertWorldToField(maxDownCoordinate
if (point.y > getHeight())
outOfBounds = true;
} catch (IllegalArgumentException ex) {
outOfBounds = true;
}
}
zoom++;
mapField.setZoom(zoom);
}
protected void paint(Graphics graphics) {
super.paint(graphics);
if (null != mPoint) {
for (int i = 0; i < mPoints.length; i++) {
if(bitmapInLocationFlag[i])
{
delete(field[i]);
}
XYPoint fieldOut = new XYPoint();
mapField.convertWorldToField(mPoints[i], fieldOut);
int imgW = mPoint.getWidth();
int imgH = mPoint.getHeight();
add(field[i],fieldOut.x - imgW / 2, fieldOut.y - imgH);
bitmapInLocationFlag[i]=true;
}
}
}
}
Please guide me jitendra... Thanks in advance.
12-06-2012
01:36 AM
- last edited on
12-06-2012
05:06 AM
by
KarlaDJR
Hi Jitendra Sharma, I gone through this forum for map. I am also new to Blackberry and i have to show the same multiple location point on map. But i don't know how to do that what extra thing i have download. Please guide me how to implement that. Also please provide me the InfoTraceRoute.java custom class on my personal I shall be very very very thanksfull to you. Please help me Its urgent for me. Hope you understand and help me to get out of this. Thanks in Advance Rahul