Geospatial mailing list archives

geospatial@odoo-community.org

Avatar

Re: Center of the map and zooming

by
Camptocamp SA, Yannick Payot
- 27/11/2017 17:50:03
For the default coordinates, look at the "default_extent" field on the view definition, this field is the area on which the map is centered.

default_extent = fields.Char( 'Default map extent in 900913', size=128, default='-123164.85222423, 5574694.9538936, 1578017.6490538,' ' 6186191.1800898')


'-123164.85222423, 5574694.9538936, 1578017.6490538, 6186191.1800898', is the default extent which leads you to europe. It is the coordinates of a rectangle.



Once you have data, it should set the extent to match position of your data.

For zoom level this is not implemented in version 8 of the module, you can have a look at version 9 on how it was done.

Zoom by default is hardcoded, and when you have data zoom will fit your data.

Cheers,

Yannick Vaucher
Business Solutions Software Developer

Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 30
Office: +41 21 619 10 10

On 22 November 2017 at 18:02, iquadro <giuseppe.flammia@iquadro.net> wrote:
Hi

actually, I use geoengine v-8.

When I add a map in the form, I always have the map centered in the 
center of the Europe.

My question is:

How can I decide the center point that I show in the form ?

Can I decide the zoom level too?


Thanks

_______________________________________________
Mailing-List: https://odoo-community.org/groups/geospatial-48
Post to: mailto:geospatial@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


Reference