I am not getting center of map, I want to put markers on map run time,but when I try to zoom map it is not point to center, and markers are placed on same position how I refresh it.
Not sure what you're asking, but I recommend you read through this
http://developer.android.com/resources/tutorials/views/hello-mapview.html
Related
I have a map image in my java project when the user clicks on two cities I want to draw a line on the map image between these two cities, so if I do any effects like zooming the lines get affected too not just the image. how can I do that, any help would be appreciated.
so if I do any effects like zooming the lines get affected too not just the image.
Put the map image and the line in the same Parent (e.g. Group, Pane, etc). Then apply the zoom to the Parent Node, and not the map image directly.
I have static points on a map.
I use this code to draw them:
point = GeometryEngine.project(longitude, latitude, mapSR);
pointGraphic = new Graphic(point, symbol);
graphicsLayer.addGraphic(pointGraphic);
The point is drawed on the map.
Now I want to add a label to it - show under the drawn point it's longitude and latitude.
I can do it using text adding, but then when I resize the map, the text placement changes.
I want to put it like a label - let's say on the bottom right from the point.
I want it to be sensitive for zooming, and binded to the Point.
I read about dinamic labels, but it seems very complex for such a simple request.
How can I do this?
Thanks.
Individual graphics don't have labels, but you can create two graphics with the same geometry. Use your current symbol for one of them. For the other graphic, use a TextSymbol, calling setOffsetX(float) and setOffsetY(float) to place it the way you want.
I am working in Indoor Positioning System .. It will be an android app like this
I am trying to make custom View for displaying the map, First step I make a Scrollable ImageView following article called 'A simple implementation of a scrollable ImageView'
The problem is when I put a marker in the map (using another ImageView for marker), When I start scrolling .. the markers start disappearing like this
So can any one help me ? I want markers to stick into the map and only the map scroll (I mean like Google Maps)
For creating map, Canvas is a better option, in canvas you can implement scroll,zoom,rotation etc.
In canvas it supports any number of bitmaps, and also we can draw programmatically within the canvas.
I'm trying to add an image overlay that stays at center of the map when you move and get the location of the map. I tried to used marker but they stayed at specific location and also the same with groundoverlay. So I just want an image that stay in the centre of the map view. I have few ideas on how to do it but I'm trying to get the best solution. One of my idea is to use relative layout and overlay the image on top of the MapView but I think this may cause problems. let me what's the best way to do it.
FrameLayout containing both SupportMapFragment (or MapView) and ImageView.
Simplest solutions are always the best.
I have following task: I have been making Android application, and I need to set drawable marker into center of Map that if I move map or zoom map this marker will continue point to center of Map, won't move with Map. How can I do it?
You can set the center of map by getting the controller of map view and set its center.
mapView.getController().setCenter(GeoPoint);
Why would you even want to use a marker for that? It sounds like the obvious solution is to have another ImageView or ImageButton or what have you layered on top of your map with layout_gravity="center". It'll stay centred and you won't need to constantly move a marker around.