Improving performance on google maps drawing long paths - android

This question is different than this another one
So, I have been observed the native google maps app when it draw long ways on the map.
When the zoom is too far, the lines are not full of details ... I mean, when we use the google maps api and request for a path between two different points we receive the whole coordinates for draw the most detailed path on the map.
As we change the zoom the drawn lines receive more details.
The question is. Is there a way to do something like the native google maps app ? Can we ask for less details to draw the path on the map using google maps api ? Can we improve the lines drawn details as we change the zoom ?
If the answer is "no" for all of my questions, here you go another one: How can we draw a long path on map without lag issues ?
I hope I've be clear, sorry about my English.

Google Maps is probably a bitmap of that path generated by the server. A new one for every zoom level.
You can do something similar but it's quite some work. But it should be faster to generate a transparent bitmap once instead of drawing the path each time the view needs to refresh. You can also draw a path with reduced details if you simply skip some points but finding an algorithm that does not skip the important parts is quite tricky.

Related

Overlay image google maps

In my app I added the map of Google Maps and you can navigate within a given area (which can not be done through maps as it is not drawn). Now I would like to customize the map and add image overlays to the buildings so as to better target people. Let me explain with an example:
In the picture is the image of the building that I customized.
Now I want place the image over the google map. I saw that there GroundOverlay but I can not place it properly.
Does anyone have any tips?
I would recommend using Polygon Shapes instead of Images. Working with Images like you intend to do, would probably be very hard later on.
You might want to look at:
https://developers.google.com/maps/documentation/android-api/shapes

Showing a lot of points on Google Maps Android v2.0

I have a lot of points to show on Google Maps Android. I decided to draw them on the map by drawing circles with small radiuses. However, I noticed that drawing a lot of circles (around 1000) is very slow and the app does not respond well, even when the drawing is made in an AsyncTask.
Any ideas how to get around this?
The best way is to only plot what you can see on the map and when the map moves get the new points you can see so that you eventually dont have to plot anymore.
You can also look into clustering where if you have a bunch of markers in a certain area you can indicate a group of markers by just plotting one marker
this link goes over the different method you can use
https://developers.google.com/maps/articles/toomanymarkers
Consider using Markers instead and one of the clustering libraries freely available:
Android Maps Extensions
Clusterkraf
Android Maps Utils
If you are convinced you want to use Circles, you may try to use one of the libs and modify code to group Circles.

Indoor Map of Building - Android

I'm trying to create an app that will tell a person what zone of a building they are in. I'm using bluetooth dongles to get an approximate location, as oppose to exact location, and show the user on a map whereabouts they are. I would like it just to highlight the zone they are in, instead of a specific location.
I can get my hands on a floor plan of the building I am using so I'm just wondering if there is an easy way to incorporate this into some kind of map with an existing API? I found a question here which states that they just use an overlay on the image to show a marker of where the person is. Would this be a bit easier?
This is for my final year project so I would like to have some sort of flashy map if possible but I'm not sure where to start looking or if it's possible.
I also found this question which gives a great variety of apps that implement and indoor map, but I don't think I can just take this small piece of functionality that I need out of them as they seem to be complete apps.
Any information would be a great help. Anyone with experience in this sort of thing please share your knowledge :)
It doesn't sound like it'd be too complicated to just write your own custom view for this. Draw the map image to the canvas. Then for the zone the user is in, draw another 'highlight' graphic on top of the map that you just drew.
If you're not sure how to do this, there's a rather basic guide on how to create your own drawable widgets which should point you in the right direction. There are plenty of examples on drawing images to the canvas, eg this one.

Android Map Scaling

I'm trying to make an app that uses Google maps API mapviews and my problem is that when building the app I realized that the roads on Google maps scale down on zoom in and wondering if there is any way to disable this scaling as I want the full size of the roads on maximum zoom. Hopefully this picture will clear any misunderstandings:
I don't believe that you will be satisfied with the result from what you are trying to do, fixing the zoom to a specific value, which will resukt in a very pour user experience ...
But if you really want to give it a try, just use the one of the solutions in this post
good luck.

Can we use our own map in android?

Can we use our own map(Like our house map) and then use GPS to show where we are in the map?
If it is possible then how to do it?
You can do anything you want, but if you are asking if there is an easy way to do this, no.
You would have to produce a scale drawing, then map the pixel space to the scale of the image, know what geopoints represented the corners of your map, then project that onto your scaled display image.
Some open source products use tiled images similar to google maps, but they use OSM data, I suppose if you were dedicated you could use that and turn your map into tiles but I would think for your purposes it would be easier to do this your self.
You might check the google code repository etc. and other open source venues and see if anyone has done anything similar to this.
Also the best accuracy you are going to get is about 2m, and certainly not indoors (if you got a signal at all)

Categories

Resources