Opened 12 years ago

Closed 12 years ago

#387 closed enhancement (fixed)

Support center and zoom attributes of the mappanel object

Reported by: cvillemure Owned by: adube
Priority: major Milestone: 1.2.0
Component: widgets Version: trunk
Keywords: bis-1.2.0 InitialZoom mappanel center Cc:

Description

I've tried to set center and zoom attributes of the mappanel widget in gp.xml :

<options>

<center>0,4000000</center> <zoom>2</zoom>

</options>

without success. I've also tried to add the support of the OpenLayers.LonLat in Globals.xslt with the following code :

<xsl:if test="./centerString">

objOptionscenter = new OpenLayers.LonLat(<xsl:value-of select='./centerString'/>);

</xsl:if>

But that gave me the following javascript error when using the centerString option in gp.xml :

Error: this.map.getProjectionObject() is null Source File: https://.../gp/lib/client/openlayers/OpenLayers.js Line: 2488

We need to be able to specify this option in gp.xml to avoid settings the center point of the map in the template.

Change History (5)

comment:1 by adube, 12 years ago

Keywords: bis-1.2.0 added

comment:2 by adube, 12 years ago

Component: documentationwidgets
Version: 1.0trunk

I agree that the "initZoom" without an InitialView widget set is currently a big issue in GeoPrisma. Here's a list of solutions we'll all apply to make sure that all the possible requirements are met, regardless of the config used :

  • add an option in the MapPanel widget (mostly useful for the XMLConfig driver)
  • add an option in the Workspace (XMLWorkspaceConfig)
  • add an option in the MapContext (PGSQLMapContextConfig)
  • add options in the InitialView widget to be able to define different locations locally and use them the same way it would be used with a resource. It's possible that we might create a new widget out of that because that new feature is not linked to a resource and the widget must be linked to a resource in order to be included.

This is required for 1.2.

comment:3 by adube, 12 years ago

Owner: set to adube

comment:4 by adube, 12 years ago

r1279 :

  • new options for the MapPanel widget : centerString, extentString and zoom
  • these are well documented in MapPanel.rst
  • all three configs support setting this option. In both XML, you simply need to set the according MapPanel widget options. In PGSQLMapContextConfig, they become MapContext valid options.
  • the samples.xslt was modified so that from now on, the center/extent is controlled this way. If not set, it uses map.zoomToMaxExtent();

Todo

The two things remaining to do are :

  • support overriding these options in the workspace (will be covered in this ticket)
  • develop a new widget that does the same thing as the InitialView, but without being linked to a resource (will not be covered in this ticket)

comment:5 by adube, 12 years ago

Resolution: fixed
Status: newclosed

Todo

A change about the todo. Both remaining tasks are now in their own tickets (#398, #399) so I'm closing this one as completed.

Note: See TracTickets for help on using tickets.