how to implement grid over Osmdroid openstreet map in android java - java

I am creating an offline map application using osmdroid openstreet map I done maximum work but I am stuck on one task i.e. I want to show grid over on my map and that grid size should change when I zoom the map grid size should increases and when I zoom out the map grid size should decreases and also I want latitude longitude of specific grid.
if any one have any idea about how to achieve what I am asking please let me now it will be a big help for me from senior I am looking forward for my solution
thanks in advance to android developer and other who might now the solution.

Related

Android OSM zoom level 19 and above

I'm new to Android Development. I have an application that shows a MapView and I've set a bounding box to restrict the user to only viewing the tiles in a specific area. The issue I have is that I need to zoom in, past level 18. Which I've also been able to do so by setting the max zoom level. However, there aren't any tiles available from the default tile provider for zoom 19 and above I really only require up to 20, 21 max too.
Is there a way for me to create my own tiles? Have custom tiles? Generate my own map? Or if there's a tile provider that allows me to zoom into the map past level 18 and still be able to see the map tiles?
I need a higher zoom level because I'm overlaying custom markers and if it's not zoomed in enough, the markers overlap. If I scale the marker size down, it's not visible enough...
EDIT: Some other specific details I missed on my initial post,
I'm using OpenStreetMap because I need the feature it provides where I can edit the roads and tag them accordingly for future routing uses.
Also, the tiles that Google Maps provides for my selected geographical area is outdated due to recent construction and renovation. That makes the map unreliable for routing the application user.
The application's purpose is to route the user. Hence the requirement to zoom in closer to see many markers, individually. (There are a number and row of markers placed very close together, intentionally.)
Assuming you using Osmdroid, there are some know issues with > 19 zoom levels to be aware of. Basically it's a precision loss issue. There's a potential solution, however the project owner doesn't want to merge it.
Is there a way for me to create my own tiles?
Yes. There's a few tools, such as Mobac, and MapBox as well as the Ersi based products. I'm sure there are others.
Have custom tiles?
Yes, you can load any tiles source you want, online or offline that supports or can be translated to OSM's slippy map format, commonly referred to as XYZ.
Generate my own map? Or if there's a tile provider that allows me to zoom into the map past level 18 and still be able to see the map tiles?
Bing, and probably other sources, have tiles that are at 19+ for certain geographic regions, but not all. Keep in mind that storage requirements (if using offline maps) increase exponentially with zoom level.

Google Maps Heatmap Android Display

I have multiple geo-locations that have a weight of +1 or -1 in an android app. I'd like to be able to plot these points as an overlay to a google-maps activity. I thought that the best way to view the data is not on a point-by-point basis but by shading regions depending on the average density of its values. I have done a few searches and I want a heatmap-like rendering and was wondering if anyone had any direction as to how to accomplish this.
If you are okay with using a library then you can use Mapex.
https://code.google.com/p/mapex/source/browse/MapExLib/

How to use multitouch for pictures

I'm making an app in which I would like to implement an offline map service for the city Rome, I thought the simplest way to do this was to implement an high-resolution map-picture of the city, but now I am getting into two problems:
If I add a picture in eclipse to my app it is being scaled down to the size of an icon and when I scale it up again it has very low resolution, how can this be solved?
Do you have any experience with multi touch or zooming possibilites? Because when you have the map people would like to zoom in to see street-names in detail. I know you have to give the fingers coordinates x,x and y,y but is this the easiest way and how should I continue?

Java Image Generation Of Heat Map for Google Earth

I'm working on a Java program that processes some data and generates a Heat Map to display the results. This program takes a target area and divides that area into a grid, which for the sake of testing each cell is 1NM by 1NM. I generate a KML file and that for each cell in the grid is represented by a polygon and the polygon is coloured based on the value of the cell. However with the volume of data that may be used, I am worried that Google Earth may not be able to handle the amount of polygons being drawn(hundreds of polygons).
I have heard that pictures are less resource heavy for Google Earth, so is there a way of generating a image(like .jpg or .png) in Java of the Heat Map and overlaying it in Google Earth. The center of the cell is know and the 4 corners are calculated, with each cells RGB and hex value known. I'm using Geotools and JAK as libraries for this project. Any help would be greatly appreciated.
I have some GeoTools based code that generates heat map images at http://code.google.com/p/spatial-cluster-detection/ - there is code in there that will show you how to convert your grid into georeferenced imagery.
Yes, its possible, and that's as far as I can go with an answer with the information provided on the question.
However, if you already have your .kml created, it's worth a try testing it to see if Google Earth will really go crazy of if you are just speculating.

How to draw a cross on Google Maps?

I have following task - I need to draw on Google Maps a cross with certain coordinates. I know how can I do it using ItemOverlay but I think that there is means without using a custom marker. I need simple black cross with my coordinates. Please, tell me, is it possible?
UPDATE: I don't want to use ItemOverlay because I need to make a custom drawable for it and I hope there is simple android internal elements for it.
I'm sorry, but using Overlays seems to be the only way of drawing any line on Google Maps.
You could draw an ImageView right over the google maps view (with absolute positioning using margins). But then you'd have to take care of coord conversion (and reacting to user scrolling, zooming the map) "by hand".
I think you could also use SurfaceView fully aligned to google maps view and draw your marker right on it.
But both solutions are pretty much overkill; you're better off using ItemizedOverlay unless you have a really good reason no to - in which case you might wanna add some info on what's the reason, maybe we'll find you a nice solution to that one :)

Categories