Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Basic Google Maps not recentering View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/22/2013 9:47:58 AM
   
Basic Google Maps not recentering
I've got a BasicGoogleMaps webpart associated with a CustomTableDatasource and the datasource has a Filter applied to it. All pieces work together and it displays the filtered data on the map although the map does not recenter to the filtered locations, it stays on the default lat/long. When I drag the map I can see the pins in place. Any ideas on what I'm missing?

User avatar
Certified Developer 13
Certified Developer 13
josefd@kentico.com - 1/25/2013 3:15:30 AM
   
RE:Basic Google Maps not recentering
Hello,

The Basic Google Maps web part will recenter only when there is just one match found by the filter. If there are more than one match, the web part will return to the default lat. and long.

Regargs,
Josef Dvorak

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/28/2013 10:22:51 AM
   
RE:Basic Google Maps not recentering
I could probably set the default lat/lon based on a macro, looks like I might have some work to do to get that working properly. Sounds like a feature enhancement...

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/29/2013 10:19:35 PM
   
RE:Basic Google Maps not recentering
I've created a custom macro that gets and parses session value with the latitude and longitude the user has searched for and auto populates the default latitude and longitude. Only customization I had to do to the webpart was in the DataSourceControl_OnFilterChanged event, I set
BasicGoogleMaps.MapProperties.Latitude = this.Latitude;
BasicGoogleMaps.MapProperties.Longitude = this.Longitude;
because the session value was set in the OnPreRender event of the filter control and when I called RaiseOnFilterChanged(), it updates the filter and triggers the map webpart to update. Worked slick!