Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Google Maps: Markers and InfoWindows View modes: 
User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 12/28/2012 10:54:00 AM
   
Google Maps: Markers and InfoWindows
I'm attempting to style the InfoWindow with the BasicGoogleMaps webpart and in the transformation I've got my styles down although I'm can't understand why there is a white box around the InfoWindow. Can we not style the whole InfoWindow within the transformation? Or how is that done?

Secondly, I want to assign letters and/or numbers to my markers, I see I can set a value for a column from the table with an image url, but how is this done otherwise? The marker values will change based on what a user enters for search criteria.

User avatar
Kentico Consulting
Kentico Consulting
richards@kentico.com - 1/3/2013 7:32:09 AM
   
RE:Google Maps: Markers and InfoWindows
Hi,

as for the InfoWindow - check what Container are you using to display BasicGoogleMaps webpart and then go to Site Manager --> Development --> Web part containers --> select the appropriate web container.

I used BlackBox for my testing purposes and then delete the content class. Now there shouldn't be any white box around the web part. I hope that this is what you meant. (You can edit the class in your we stylesheet instead of deleting it, but it would probably would be better to delete it in this container - or use some other custom created container).

The second question you have asked is more complicated and we need to discuss is with our developers and find some solutions, if possible. Thank you for your patience.

Best regards,
Richard Šůstek

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/3/2013 9:29:36 AM
   
RE:Google Maps: Markers and InfoWindows
My webpart does not have a container wrapped around it. When I view the source code generated, there is a master div and roughly 10 other nested divs and the last div is where the transformation comes into play. So it doesn't seem it would matter where I had my transformation code because all the html prior to my content being placed is automatically generated. See image below:
User image

In regards to the map marker, I was able to find a website that actually simplifies the process Google uses to format your marker. All I do is create a column with the URL and required formatting info in my SQL SelectedColumns statement like so (generates a letter):
this.SelectedColumns += ", 'http://www.googlemapsmarkers.com/v1/' + CHAR(64+ROW_NUMBER() OVER (ORDER BY <DistanceColumn>)) + '/E1373E/FFFFFF/EFE5CD/' AS MapMarker";

I'm not saying this is a permenant solution but it works, for now and until this can be added to the current webparts, I'll use this.
NumberUser imageLetterUser image

User avatar
Kentico Consulting
Kentico Consulting
richards@kentico.com - 1/4/2013 3:20:37 AM
   
RE:Google Maps: Markers and InfoWindows
Thats quite elegant solution and I think others may want to use it too, thanks for posting that.

I now get what you mean and as I found out, there is no easy way to do this, it requires coding and access to the source code of kentico. However, it may be easier if you would create your own web part to show these maps and style them as you like. I have found some sources that explains how to do it.

Can you take a look at this http://stackoverflow.com/questions/3860277/google-maps-how-to-create-a-custom-infowindow ? It should be able to guide you through styling the google map infoboxes.

Does it help?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 1/7/2013 12:37:35 PM
   
RE:Google Maps: Markers and InfoWindows
Thanks for the reference! I found out InfoWindows aren't as customizable as other options Google Maps offers. I did as you suggested although only copied the BasicGoogleMaps webpart and just implemented some custom javascript to use an InfoBubble, which has 100% styling abilities to it.

What I have found is it looks like the BasicGoogleMaps webpart imports the Google Maps API twice though
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script>
Once in the <head> tag and once in-line which I don't believe is correct. I have posted a bug report on it as well.

User avatar
Kentico Consulting
Kentico Consulting
richards@kentico.com - 1/8/2013 8:52:25 AM
   
RE:Google Maps: Markers and InfoWindows
You are welcome. We've forwarded this issue to our developers's team and answered in the corresponding bug report topic you have created at http://devnet.kentico.com/Forums.aspx?forumid=73&threadid=34089