Why not ask your question on the new OpenStreetMap Community Forum?


i want to display all my points in the map and adjust zoom automatically based on the number of points, if there are more points all points should be shown with zoom out, if there are 1 point only that point has to be shown with max zoom level

please suggest solution how to achieve this

Thanks Kiran

asked 21 Feb '13, 09:52

amkiranv's gravatar image

accept rate: 0%

edited 21 Feb '13, 20:08

gormo's gravatar image



Where? You added Nominatim and JOSM as tags but I guess you are using either Leaflet or OpenLayers instead.

(21 Feb '13, 09:56) scai ♦

yes am using OpenLayers

(21 Feb '13, 10:07) amkiranv

This is a OpenLayers question.

Use a http://dev.openlayers.org/apidocs/files/OpenLayers/BaseTypes/Bounds-js.html , fill it with all your points, then zoom the OpenLayers viewport to the created bounds object using http://dev.openlayers.org/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.zoomToExtent .

permanent link

answered 21 Feb '13, 20:06

gormo's gravatar image

accept rate: 13%

edited 21 Feb '13, 20:07

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 21 Feb '13, 09:52

question was seen: 5,622 times

last updated: 21 Feb '13, 20:08

powered by OSQA