dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16653
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6381: (GIS) Load map views by adding id=<uid> to the url. You can also choose background by adding base...
Merge authors:
Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 6381 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-03-26 15:08:37 +0200
message:
(GIS) Load map views by adding id=<uid> to the url. You can also choose background by adding base=googlestreets/googlehybrid/osm
removed:
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/MapViewFixedDateTypeFilter.java
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java
dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml
dhis-2/dhis-services/dhis-service-mapping/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java
dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/InitializeAction.java
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js
dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java 2012-03-19 18:32:42 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapView.java 2012-03-26 13:00:42 +0000
@@ -67,8 +67,6 @@
private DataElement dataElement;
- private String mapDateType;
-
private PeriodType periodType;
private Period period;
@@ -106,7 +104,7 @@
}
public MapView( String name, User user, String mapValueType, IndicatorGroup indicatorGroup, Indicator indicator,
- DataElementGroup dataElementGroup, DataElement dataElement, String mapDateType, PeriodType periodType,
+ DataElementGroup dataElementGroup, DataElement dataElement, PeriodType periodType,
Period period, OrganisationUnit parentOrganisationUnit, OrganisationUnitLevel organisationUnitLevel,
String mapLegendType, Integer method, Integer classes, String bounds, String colorLow, String colorHigh,
MapLegendSet mapLegendSet, Integer radiusLow, Integer radiusHigh, String longitude, String latitude, int zoom )
@@ -118,7 +116,6 @@
this.indicator = indicator;
this.dataElementGroup = dataElementGroup;
this.dataElement = dataElement;
- this.mapDateType = mapDateType;
this.periodType = periodType;
this.period = period;
this.parentOrganisationUnit = parentOrganisationUnit;
@@ -178,15 +175,6 @@
}
// -------------------------------------------------------------------------
- // Logic
- // -------------------------------------------------------------------------
-
- public String getMapDateTypeNullSafe()
- {
- return mapDateType != null ? mapDateType : MappingService.MAP_DATE_TYPE_FIXED;
- }
-
- // -------------------------------------------------------------------------
// Getters and setters
// -------------------------------------------------------------------------
@@ -273,19 +261,6 @@
this.dataElement = dataElement;
}
- @JsonProperty
- @JsonView( {DetailedView.class, ExportView.class} )
- @JacksonXmlProperty
- public String getMapDateType()
- {
- return mapDateType;
- }
-
- public void setMapDateType( String mapDateType )
- {
- this.mapDateType = mapDateType;
- }
-
public PeriodType getPeriodType()
{
return periodType;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-03-20 11:58:22 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-03-26 13:00:42 +0000
@@ -131,6 +131,7 @@
executeSql( "ALTER TABLE mapview DROP COLUMN enddate" );
executeSql( "ALTER TABLE mapview DROP COLUMN mapsource" );
executeSql( "ALTER TABLE mapview DROP COLUMN mapsourcetype" );
+ executeSql( "ALTER TABLE mapview DROP COLUMN mapdatetype" );
executeSql( "DROP TABLE map" );
executeSql( "DELETE FROM systemsetting WHERE name = 'longitude'" );
executeSql( "DELETE FROM systemsetting WHERE name = 'latitude'" );
=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java 2012-03-22 12:34:46 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java 2012-03-26 13:00:42 +0000
@@ -160,9 +160,9 @@
/**
* Returns the relevant OrganisationUnits for the given parent identifier
* and / or level.
- *
+ *
* @param parentOrganisationUnitId the OrganisationUnit level.
- * @param level the OrganisationUnit level.
+ * @param level the OrganisationUnit level.
* @return a collection of OrganisationUnits.
*/
private Collection<OrganisationUnit> getOrganisationUnits( Integer parentOrganisationUnitId, Integer level )
@@ -196,23 +196,24 @@
* and level must be specified. Period should be specified with "real time"
* aggregation strategy, any may be specified with "batch" aggregation
* strategy.
- *
- * @param indicatorId the Indicator identifier.
- * @param periodId the Period identifier. Ignored if null.
+ *
+ * @param indicatorId the Indicator identifier.
+ * @param periodId the Period identifier. Ignored if null.
* @param parentOrganisationUnitId the parent OrganisationUnit identifier.
- * Ignored if null.
- * @param level the OrganisationUnit level. Ignored if null.
+ * Ignored if null.
+ * @param level the OrganisationUnit level. Ignored if null.
* @return a collection of AggregatedMapValues.
*/
public Collection<AggregatedMapValue> getIndicatorMapValues( int indicatorId, int periodId,
- int parentOrganisationUnitId, Integer level )
+ int parentOrganisationUnitId, Integer level )
{
Collection<OrganisationUnit> units = getOrganisationUnits( parentOrganisationUnitId, level );
return getIndicatorMapValues( indicatorId, periodId, units );
}
- public Collection<AggregatedMapValue> getIndicatorMapValues( int indicatorId, int periodId, Collection<OrganisationUnit> units )
+ public Collection<AggregatedMapValue> getIndicatorMapValues( int indicatorId, int periodId,
+ Collection<OrganisationUnit> units )
{
Collection<AggregatedMapValue> values = aggregatedDataValueService.getAggregatedIndicatorMapValues(
indicatorId, periodId, ConversionUtils.getIdentifiers( OrganisationUnit.class, units ) );
@@ -235,23 +236,24 @@
* and level must be specified. Period should be specified with "real time"
* aggregation strategy, any may be specified with "batch" aggregation
* strategy.
- *
- * @param dataElementId the DataElement identifier.
- * @param periodId the Period identifier. Ignored if null.
+ *
+ * @param dataElementId the DataElement identifier.
+ * @param periodId the Period identifier. Ignored if null.
* @param parentOrganisationUnitId the parent OrganisationUnit identifier.
- * Ignored if null.
- * @param level the OrganisationUnit level. Ignored if null.
+ * Ignored if null.
+ * @param level the OrganisationUnit level. Ignored if null.
* @return a collection of AggregatedMapValues.
*/
public Collection<AggregatedMapValue> getDataElementMapValues( int dataElementId, int periodId,
- int parentOrganisationUnitId, Integer level )
+ int parentOrganisationUnitId, Integer level )
{
Collection<OrganisationUnit> units = getOrganisationUnits( parentOrganisationUnitId, level );
return getDataElementMapValues( dataElementId, periodId, units );
}
- public Collection<AggregatedMapValue> getDataElementMapValues( int dataElementId, int periodId, Collection<OrganisationUnit> units )
+ public Collection<AggregatedMapValue> getDataElementMapValues( int dataElementId, int periodId,
+ Collection<OrganisationUnit> units )
{
Collection<AggregatedMapValue> values = aggregatedDataValueService.getAggregatedDataMapValues( dataElementId,
periodId, ConversionUtils.getIdentifiers( OrganisationUnit.class, units ) );
@@ -265,7 +267,7 @@
}
public Collection<AggregatedMapValue> getInfrastructuralDataElementMapValues( Integer periodId,
- Integer organisationUnitId )
+ Integer organisationUnitId )
{
DataElementGroup group = configurationService.getConfiguration().getInfrastructuralDataElements();
@@ -463,10 +465,10 @@
}
public void addMapView( String name, boolean system, String mapValueType, Integer indicatorGroupId,
- Integer indicatorId, Integer dataElementGroupId, Integer dataElementId, String periodTypeName,
- Integer periodId, Integer parentOrganisationUnitId, Integer organisationUnitLevel, String mapLegendType,
- Integer method, Integer classes, String bounds, String colorLow, String colorHigh, Integer mapLegendSetId,
- Integer radiusLow, Integer radiusHigh, String longitude, String latitude, int zoom )
+ Integer indicatorId, Integer dataElementGroupId, Integer dataElementId, String periodTypeName,
+ Integer periodId, Integer parentOrganisationUnitId, Integer organisationUnitLevel, String mapLegendType,
+ Integer method, Integer classes, String bounds, String colorLow, String colorHigh, Integer mapLegendSetId,
+ Integer radiusLow, Integer radiusHigh, String longitude, String latitude, int zoom )
{
User user = system ? null : currentUserService.getCurrentUser();
@@ -489,8 +491,6 @@
dataElement = dataElementService.getDataElement( dataElementId );
}
- String mapDateType = (String) userSettingService.getUserSetting( KEY_MAP_DATE_TYPE, MAP_DATE_TYPE_FIXED );
-
PeriodType periodType = periodTypeName != null && !periodTypeName.isEmpty() ? periodService
.getPeriodTypeByClass( PeriodType.getPeriodTypeByName( periodTypeName ).getClass() ) : null;
@@ -503,8 +503,8 @@
MapLegendSet mapLegendSet = mapLegendSetId != null ? getMapLegendSet( mapLegendSetId ) : null;
addMapView( new MapView( name, user, mapValueType, indicatorGroup, indicator, dataElementGroup, dataElement,
- mapDateType, periodType, period, parent, level, mapLegendType, method, classes, bounds,
- colorLow, colorHigh, mapLegendSet, radiusLow, radiusHigh, longitude, latitude, zoom ) );
+ periodType, period, parent, level, mapLegendType, method, classes, bounds, colorLow, colorHigh,
+ mapLegendSet, radiusLow, radiusHigh, longitude, latitude, zoom ) );
}
public void updateMapView( MapView mapView )
@@ -539,8 +539,8 @@
{
if ( mapView != null )
{
- mapView.getParentOrganisationUnit().setLevel( organisationUnitService.getLevelOfOrganisationUnit(
- mapView.getParentOrganisationUnit().getId() ) );
+ mapView.getParentOrganisationUnit().setLevel(
+ organisationUnitService.getLevelOfOrganisationUnit( mapView.getParentOrganisationUnit().getId() ) );
}
}
@@ -553,8 +553,8 @@
{
MapView mapView = new MapView();
- Period period = periodService.reloadPeriod(
- new RelativePeriods().setThisYear( true ).getRelativePeriods().iterator().next() );
+ Period period = periodService.reloadPeriod( new RelativePeriods().setThisYear( true ).getRelativePeriods()
+ .iterator().next() );
Indicator indicator = indicatorService.getIndicator( indicatorUid );
OrganisationUnit unit = organisationUnitService.getOrganisationUnit( organisationUnitUid );
@@ -579,8 +579,8 @@
{
for ( MapView mapView : mapViews )
{
- mapView.getParentOrganisationUnit().setLevel( organisationUnitService.getLevelOfOrganisationUnit(
- mapView.getParentOrganisationUnit().getId() ) );
+ mapView.getParentOrganisationUnit().setLevel(
+ organisationUnitService.getLevelOfOrganisationUnit( mapView.getParentOrganisationUnit().getId() ) );
}
}
@@ -595,8 +595,8 @@
for ( MapView mapView : mapViews )
{
- mapView.getParentOrganisationUnit().setLevel( organisationUnitService.getLevelOfOrganisationUnit(
- mapView.getParentOrganisationUnit().getId() ) );
+ mapView.getParentOrganisationUnit().setLevel(
+ organisationUnitService.getLevelOfOrganisationUnit( mapView.getParentOrganisationUnit().getId() ) );
}
return mapViews;
@@ -617,7 +617,7 @@
}
public void addOrUpdateMapLayer( String name, String type, String url, String layers, String time,
- String fillColor, double fillOpacity, String strokeColor, int strokeWidth )
+ String fillColor, double fillOpacity, String strokeColor, int strokeWidth )
{
MapLayer mapLayer = mapLayerStore.getByName( name );
=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml 2011-12-05 12:21:38 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml 2012-03-26 13:00:42 +0000
@@ -29,8 +29,6 @@
<many-to-one name="dataElement" class="org.hisp.dhis.dataelement.DataElement" column="dataelementid"
foreign-key="fk_mapview_dataelementid" />
- <property name="mapDateType" />
-
<many-to-one name="periodType" class="org.hisp.dhis.period.PeriodType" column="periodtypeid"
foreign-key="fk_mapview_periodtypeid" />
=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/test/java/org/hisp/dhis/mapping/MappingServiceTest.java 2012-03-26 13:00:42 +0000
@@ -334,7 +334,7 @@
public void testAddGetMapView()
{
MapView mapView = new MapView( "MapViewA", null, MappingService.MAP_VALUE_TYPE_INDICATOR, indicatorGroup,
- indicator, dataElementGroup, dataElement, MappingService.MAP_DATE_TYPE_FIXED, periodType, period,
+ indicator, dataElementGroup, dataElement, periodType, period,
organisationUnit, organisationUnitLevel, MappingService.MAPLEGENDSET_TYPE_AUTOMATIC, 1, 1, "", "A", "B",
mapLegendSet, 5, 20, "1", "1", 1 );
@@ -351,7 +351,7 @@
public void testGetDeleteMapViewByName()
{
MapView mapView = new MapView( "MapViewA", null, MappingService.MAP_VALUE_TYPE_INDICATOR, indicatorGroup,
- indicator, dataElementGroup, dataElement, MappingService.MAP_DATE_TYPE_FIXED, periodType, period,
+ indicator, dataElementGroup, dataElement, periodType, period,
organisationUnit, organisationUnitLevel, MappingService.MAPLEGENDSET_TYPE_AUTOMATIC, 1, 1, "", "A", "B",
mapLegendSet, 5, 20, "1", "1", 1 );
@@ -368,12 +368,12 @@
public void testGetAllMapViews()
{
MapView mapView1 = new MapView( "MapViewA", null, MappingService.MAP_VALUE_TYPE_INDICATOR, indicatorGroup,
- indicator, dataElementGroup, dataElement, MappingService.MAP_DATE_TYPE_FIXED, periodType, period,
+ indicator, dataElementGroup, dataElement, periodType, period,
organisationUnit, organisationUnitLevel, MappingService.MAPLEGENDSET_TYPE_AUTOMATIC, 1, 1, "", "A", "B",
mapLegendSet, 5, 20, "1", "1", 1 );
MapView mapView2 = new MapView( "MapViewB", null, MappingService.MAP_VALUE_TYPE_DATAELEMENT, indicatorGroup,
- indicator, dataElementGroup, dataElement, MappingService.MAP_DATE_TYPE_START_END, periodType, period,
+ indicator, dataElementGroup, dataElement, periodType, period,
organisationUnit, organisationUnitLevel, MappingService.MAPLEGENDSET_TYPE_AUTOMATIC, 1, 1, "", "A", "B",
mapLegendSet, 5, 20, "2", "2", 1 );
@@ -389,17 +389,17 @@
public void testGetMapViewsByFeatureType()
{
MapView mapView1 = new MapView( "MapViewA", null, MappingService.MAP_VALUE_TYPE_INDICATOR, indicatorGroup,
- indicator, dataElementGroup, dataElement, MappingService.MAP_DATE_TYPE_FIXED, periodType, period,
+ indicator, dataElementGroup, dataElement, periodType, period,
organisationUnit, organisationUnitLevel, MappingService.MAPLEGENDSET_TYPE_AUTOMATIC, 1, 1, "", "A", "B",
mapLegendSet, 5, 20, "1", "1", 1 );
MapView mapView2 = new MapView( "MapViewB", null, MappingService.MAP_VALUE_TYPE_DATAELEMENT, indicatorGroup,
- indicator, dataElementGroup, dataElement, MappingService.MAP_DATE_TYPE_START_END, periodType, period,
+ indicator, dataElementGroup, dataElement, periodType, period,
organisationUnit, organisationUnitLevel, MappingService.MAPLEGENDSET_TYPE_AUTOMATIC, 1, 1, "", "A", "B",
mapLegendSet, 5, 20, "2", "2", 1 );
MapView mapView3 = new MapView( "MapViewC", null, MappingService.MAP_VALUE_TYPE_DATAELEMENT, indicatorGroup,
- indicator, dataElementGroup, dataElement, MappingService.MAP_DATE_TYPE_START_END, periodType, period,
+ indicator, dataElementGroup, dataElement, periodType, period,
organisationUnit, organisationUnitLevel, MappingService.MAPLEGENDSET_TYPE_AUTOMATIC, 1, 1, "", "A", "B",
mapLegendSet, 5, 20, "3", "3", 1 );
=== removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/MapViewFixedDateTypeFilter.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/MapViewFixedDateTypeFilter.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/filter/MapViewFixedDateTypeFilter.java 1970-01-01 00:00:00 +0000
@@ -1,45 +0,0 @@
-package org.hisp.dhis.system.filter;
-
-/*
- * Copyright (c) 2004-2012, University of Oslo
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of the HISP project nor the names of its contributors may
- * be used to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-import org.hisp.dhis.mapping.MapView;
-import org.hisp.dhis.mapping.MappingService;
-import org.hisp.dhis.system.util.Filter;
-
-/**
- * @author Jan Henrik Overland
- */
-public class MapViewFixedDateTypeFilter
- implements Filter<MapView>
-{
- @Override
- public boolean retain( MapView object )
- {
- return object != null && object.getMapDateType().equals( MappingService.MAP_DATE_TYPE_FIXED );
- }
-}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/InitializeAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/InitializeAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/InitializeAction.java 2012-03-26 13:00:42 +0000
@@ -91,9 +91,9 @@
// Input
// -------------------------------------------------------------------------
- private Integer id;
+ private String id;
- public void setId( Integer id )
+ public void setId( String id )
{
this.id = id;
}
@@ -109,13 +109,6 @@
return mapView;
}
- private String mapDateType;
-
- public String getMapDateType()
- {
- return mapDateType;
- }
-
private List<MapLayer> baseLayers;
public List<MapLayer> getBaseLayers()
@@ -158,16 +151,9 @@
public String execute()
throws Exception
{
- if ( id == null )
- {
- mapDateType = (String) userSettingService.getUserSetting( KEY_MAP_DATE_TYPE, MAP_DATE_TYPE_FIXED );
- }
-
- else
+ if ( id != null )
{
mapView = mappingService.getMapView( id );
-
- mapDateType = mapView.getMapDateType();
}
baseLayers = new ArrayList<MapLayer>(
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm 2011-12-01 15:49:20 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/jsonInitialize.vm 2012-03-26 13:00:42 +0000
@@ -10,7 +10,6 @@
"indicatorId": "$!{mapView.indicator.id}",
"dataElementGroupId": "$!{mapView.dataElementGroup.id}",
"dataElementId": "$!{mapView.dataElement.id}",
- "mapDateType": "$!encoder.jsonEncode( ${mapView.mapDateTypeNullSafe} )",
"periodTypeId": "$!encoder.jsonEncode( ${mapView.periodType.name} )",
"periodId": "$!{mapView.period.id}",
"parentOrganisationUnitId": "$!{mapView.parentOrganisationUnit.id}",
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js 2012-03-23 11:06:09 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/global.js 2012-03-26 13:00:42 +0000
@@ -4,6 +4,7 @@
path_mapping: '../',
path_commons: '../../dhis-web-commons-ajax-json/',
+ path_api: '../../api/',
type: '.action',
// Layer names
@@ -158,22 +159,24 @@
widget.expand();
},
- getUrlParam: function(strParam) {
- var output = '';
- var strHref = window.location.href;
- if (strHref.indexOf('?') > -1 ) {
- var strQueryString = strHref.substr(strHref.indexOf('?')).toLowerCase();
- var aQueryString = strQueryString.split('&');
- for (var iParam = 0; iParam < aQueryString.length; iParam++) {
- if (aQueryString[iParam].indexOf(strParam.toLowerCase() + '=') > -1) {
- var aParam = aQueryString[iParam].split('=');
- output = aParam[1];
- break;
- }
- }
- }
- return unescape(output);
- },
+ getUrlParam: function(s) {
+ var output = '';
+ var href = window.location.href;
+ if (href.indexOf('?') > -1 ) {
+ var query = href.substr(href.indexOf('?') + 1);
+ var query = query.split('&');
+ for (var i = 0; i < query.length; i++) {
+ if (query[i].indexOf('=') > -1) {
+ var a = query[i].split('=');
+ if (a[0].toLowerCase() === s) {
+ output = a[1];
+ break;
+ }
+ }
+ }
+ }
+ return unescape(output);
+ },
getKeys: function(obj) {
var temp = [];
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js 2012-03-25 11:59:43 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/javascript/index.js 2012-03-26 13:07:14 +0000
@@ -12,8 +12,9 @@
});
G.vars.mask = new Ext.LoadMask(Ext.getBody(),{msg:G.i18n.loading,msgCls:'x-mask-loading2'});
- G.vars.parameter = G.util.getUrlParam('view') ? {id: G.util.getUrlParam('view')} : {id: null};
-
+ G.vars.parameter = G.util.getUrlParam('id') ? {id: G.util.getUrlParam('id')} : {id: null};
+ G.vars.parameter.base = G.util.getUrlParam('base') ? G.util.getUrlParam('base') : 'none';
+
Ext.Ajax.request({
url: G.conf.path_mapping + 'initialize' + G.conf.type,
params: {id: G.vars.parameter.id || null},
@@ -416,7 +417,7 @@
G.vars.map.addLayer(ghyb);
}
- var osm = new OpenLayers.Layer.OSM.Osmarender("OpenStreetMap");
+ var osm = new OpenLayers.Layer.OSM("OpenStreetMap");
osm.layerType = G.conf.map_layer_type_baselayer;
G.vars.map.addLayer(osm);
@@ -2927,7 +2928,19 @@
G.util.setOpacityByLayerType(G.conf.map_layer_type_thematic, G.conf.defaultLayerOpacity);
symbolLayer.setOpacity(1);
centroidLayer.setOpacity(1);
- G.vars.map.getLayersByName('Google Streets')[0].setVisibility(false);
+
+ if (G.vars.parameter.base === 'googlestreets') {
+ G.vars.map.getLayersByName('Google Streets')[0].setVisibility(true);
+ }
+ else if (G.vars.parameter.base === 'googlehybrid') {
+ G.vars.map.getLayersByName('Google Hybrid')[0].setVisibility(true);
+ }
+ else if (G.vars.parameter.base === 'osm') {
+ G.vars.map.getLayersByName('OpenStreetMap')[0].setVisibility(true);
+ }
+ else {
+ G.vars.map.getLayersByName('Google Streets')[0].setVisibility(false);
+ }
var svg = document.getElementsByTagName('svg');
@@ -3007,7 +3020,7 @@
helpWindow.setPagePosition(c+((e-c)/2)-(helpWindow.width/2), Ext.getCmp('east').y + 100);
if (G.vars.parameter.id) {
- G.util.mapView.mapView.call(choropleth, G.vars.parameter.id);
+ G.util.mapView.launch.call(choropleth, G.vars.parameter.mapView);
G.vars.parameter.id = null;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2012-03-25 11:59:43 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/resources/mapfish/widgets/geostat/Choropleth.js 2012-03-26 13:00:42 +0000
@@ -1607,7 +1607,7 @@
},
clearForm: function(clearLayer) {
- this.cmp.mapview.clearValue();
+ this.cmp.mapview.clearValue();
this.cmp.mapValueType.setValue(G.conf.map_value_type_indicator);
this.valueType.setIndicator();