N
N
Nikolai Kolomiytsev2014-12-20 23:42:33
Android
Nikolai Kolomiytsev, 2014-12-20 23:42:33

Need to make a small semblance of a map, how to scale a separate layer?

99qQWB9rqxA.jpg
I have a map, I need to make the elements on it interactive. When I click on a certain building, I see information about it and the building is highlighted in color, now it turns out like this.
yqJBeUmhyO0.jpg
The selection goes by replacing the texture of the map.
How does the map know where I clicked?
I compare the percentage of clicks on the screen.
With the ratio of this shed that was given earlier.
The solution is probably very go * nokodskoe but it had to be done quickly and nothing came to mind, I'm sorry.
I have only two questions:
1. Can I, and if so, how, select the building as in the screenshot below.
2. On the Internet, I did not find an answer to the question of scaling and rotate of a layer (not a picture), namely a layer like in Google Maps.
Please help me with this, it is very important for me.

//Коричневое поле
            for(int a = 58; a<=64; a ++){
            	if((int)xPercentage == a ){
            	for(int i = 48; i<=62; i ++){
                	if((int)yPercentage == i ){
                		Drawable bitmap = getResources().getDrawable(R.drawable.map_three);
                        iv.setImageDrawable(bitmap);
                		new AlertDialog.Builder(MainActivity.this).setMessage("Коричневое поле.").setPositiveButton("OK", new DialogInterface.OnClickListener()
                        {
                          public void onClick(DialogInterface paramDialogInterface, int paramInt)
                          {
                        	  paramDialogInterface.dismiss();
                        	  Drawable bitmap = getResources().getDrawable(R.drawable.map);
                              iv.setImageDrawable(bitmap);
                           
                          }
                        }).show();
                	}
                }	
            }
        }

Oh-pfbDTFoM.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
boomwest, 2014-12-22
@boomwest

In order to paint over a region (building) in
Google maps api there is a method addPolygon(PolygonOptions options)). He zooms, rotates.
I think that onclicklistener can be hung on the polygon.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question