Android: How do I set the zoom level of map view to 1 km radius around my current location?

although this answer is logical and i find it working but the results are not accurate i dont know why but i tired this approach and this technique is far more accurate. 1) Make a circle on object with desired radius Circle circle = mGoogleMap.addCircle(new CircleOptions().center(new LatLng(latitude, longitude)).radius(getRadiusInMeters()).strokeColor(Color.RED)); circle.setVisible(true); getZoomLevel(circle); 2) Pass that object to … Read more

How to implement zoom effect for image view in android?

Lazy man can use this lib, Just import inside your project and ImageView mImageView; PhotoViewAttacher mAttacher; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Any implementation of ImageView can be used! mImageView = (ImageView) findViewById(R.id.iv_photo); // Set the Drawable displayed Drawable bitmap = getResources().getDrawable(R.drawable.wallpaper); mImageView.setImageDrawable(bitmap); // Attach a PhotoViewAttacher, which takes care of all … Read more

enable/disable zoom in Android WebView

On API >= 11, you can use: wv.getSettings().setBuiltInZoomControls(true); wv.getSettings().setDisplayZoomControls(false); As per the SDK: public void setDisplayZoomControls (boolean enabled) Since: API Level 11 Sets whether the on screen zoom buttons are used. A combination of built in zoom controls enabled and on screen zoom controls disabled allows for pinch to zoom to work without the on … Read more

Zoom Vs. Scale in CSS3

Transform is more predictable than zoom across browsers. Zoom affects positioning differently in different browsers. example: position:absolute; left:50px; zoom: 50%; Chrome will effectively compute the left value to 50px * 50%, that is 25px…but this is not reflected in DevTools Computed Values. IE will not change the left value at all. Transform is handled the … Read more

Is there a way to zoom into a D3 force layout graph?

Update 6/4/14 See also Mike Bostock’s answer here for changes in D3 v.3 and the related example. I think this probably supersedes the answer below. Update 2/18/2014 I think @ahaarnos’s answer is preferable if you want the entire SVG to pan and zoom. The nested g elements in my answer below are really only necessary … Read more

MKMapView Zoom and Region

First of all, MKMapView does not use/have a predefined set of zoom levels like Google Maps does. Instead, the visible area of a MKMapView is described using MKCoordinateRegion, which consists of two values: center (the center point of the region), and span (the size of the visible area around center). The center point should be … Read more

Zoom Canvas to Mouse Cursor

In short, you want to translate() the canvas context by your offset, scale() it to zoom in or out, and then translate() back by the opposite of the mouse offset. Note that you need to transform the cursor position from screen space into the transformed canvas context. ctx.translate(pt.x,pt.y); ctx.scale(factor,factor); ctx.translate(-pt.x,-pt.y); Demo: http://phrogz.net/tmp/canvas_zoom_to_cursor.html I’ve put up … Read more