Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Google Map with DataSource View modes: 
User avatar
Member
Member
stacey.abshire-terradon - 3/15/2011 10:33:25 AM
   
Google Map with DataSource
Trying to setup a Google Map, with a custom filter and datasource, but need some direction. I have used the map using the standard Path and Document.Type filters that are porperties of the webpart, but I need to be able to use a custom filter webpart with the map. Can this be done?

User avatar
Member
Member
snk1324 - 3/18/2011 9:57:50 AM
   
RE:Google Map with DataSource
Well, I was able to do this by modifying the GoogleMpas web part. I cloned it, and made the following changes that I thought I would share with everyone.

in the "Document properties" region:


protected CMSDocumentsDataSource mDataSourceControl = null;

/// <summary>
/// Filter name.
/// </summary>
public string FilterName
{
get
{
return ValidationHelper.GetString(GetValue("FilterName"), repItems.FilterName);
}
set
{
SetValue("FilterName", value);
repItems.FilterName = value;
}
}


/// <summary>
/// Data source name.
/// </summary>
public string DataSourceName
{
get
{
return ValidationHelper.GetString(GetValue("DataSourceName"), repItems.DataSourceName);
}
set
{
SetValue("DataSourceName", value);
repItems.DataSourceName = value;
}
}


/// <summary>
/// Control with data source.
/// </summary>
public CMSDocumentsDataSource DataSourceControl
{
get
{
return mDataSourceControl;
}
set
{
mDataSourceControl = value;
repItems.DataSourceControl = value;
}
}



In the SetupControl method, in the else block add the following:



//Additions to Allow GoogleMaps to work with Filter Control
this.repItems.FilterName = FilterName;
this.repItems.DataSourceName = DataSourceName;
this.repItems.DataSourceControl = DataSourceControl;




On the WebPart, connect these new properties by creating the following new fields:

FilterName Text size 200, allow empty values
DataSourceName Text size 200, allow empty values


Then you should be able to use a datasource tied to a filter on the GoogleMaps webaprt. Hopefully, leaving this out of the webpart was just an oversight by Kentico.

User avatar
Member
Member
kentico_michal - 3/22/2011 3:02:49 AM
   
RE:Google Map with DataSource
Hi,

Thank you for posting your solution. It will be helpful for other users.

Best regards,
Michal Legen