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.
Related
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 an imageview containing a bitmap that can be zoomed into and scrolled. i've used the setImageBitmap() method instead of setting the image on a canvas. the imageview acts as a map which the user can browse through. now, my application is supposed to allow the user to marker points of interest with push-pins as done in Google Maps on a point selected on the imageview by the user. i've gotten the ability to pick up which point on the original bitmap was selected using a modified implementation of the OnTouch() method to work so i know where exactly the marker has to be placed.
i want to set a marker to this location and pass a string into a database to store information about the location so that when the marker is tapped, this information is shown in a bubble/toast notification.
as of now, i can scroll the image, sense a longTouch event on the imageview, save point of tap, move to new activity to collect information to add in the database. i can't seem to find a way to set up my markers on the original imageview.
also, i'm guessing i'd have to use an ArrayList implementation here to get markers with individual IDs that could be correlated to the ID in the database fields but i don't understand how to implement that.
i looked around the Internet for a solution or an idea and i've tried many things before posting here but nothing seems to work.
using a canvas' draw functions wouldn't allow for onTap functions to show info notifications. the drawn bitmaps also lose scale and quality while zooming. i tried making a custom class extending RelativeLayout to act an an invisible layer on my imageview but i don't know how to place markers in exact locations and also make the custom RelativeLayout easier. i tried placing a false transparent canvas of the same dimensions as my bitmap to get scaling to work and allow me to place markers at absolute locations but it didn't work. plus, using onTouch events on the custom RelativeLayout class meant i couldn't use the onTouch events on the lower imageview class.
i can't seem to come up with any solutions that can help me implement the mechanism as i want to, so i'm open to any sorta idea that can be thrown at me. i'd appreciate some help.
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