Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > offices and google map web part View modes: 
User avatar
Member
Member
pavel.1991-tut - 4/12/2013 3:03:52 AM
   
offices and google map web part
I've made document type and named it "office". There are fields "description", "title" and "location" in this document type. Then I used repeater to display offices list. And I need that every office have its own google map and each google map web part use coordinates from the field "location". How can I do this? Or how would you do this?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 4/12/2013 9:51:15 AM
   
RE:offices and google map web part
Just a question, have you read through the developer documentation? There is great detail on how this works in there. Many of the questions you are asking can be answered within the documentation and a simple search within the documentation will show you what you need to do.

http://devnet.kentico.com/docs/devguide/index.html?geomapping_google_maps.htm

Also if you load the E-Commerce site, I beleive you can get examples for most everything you are looking for there. The best part is you will learn a lot more by looking through this documentation and sample sites then just simply asking for an answer for everything.

Sorry this was less than helpful but I'm positive you will find your answer with the suggestions above.

User avatar
Member
Member
pavel.1991-tut - 4/15/2013 3:13:57 AM
   
RE:offices and google map web part
Yes, I read documentation. But unfortunately I'm not C# developer, I'm html and js coder and I had only two weeks to study CMS kentico. Moreover all documentation are in English and my native language is Russian.
As for my question. I know how to use web-part google map, but I want that user create new documents using my document type, fill fields "title', "description" and "coordinates" and using repeater there appear list of offices on a page. And each office must have its own google map. I've loaded Corporate Site and there is a page with offices and google map, but on this page there is only one map for all offices. But I want that there be google map for each office and I do not know how to do this. Thanks.

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 4/15/2013 8:22:01 AM
   
RE:offices and google map web part
Hello Pavel,

As FroggEye mentioned Kentico CMS comes with more than Corporate Site sample template. I would suggest taking a look at the other templates, as they can show interesting applications of Kentico CMS features. The example FroggEye mentioned looks like this:

<%@ Register Src="~/CMSWebParts/Maps/Static/StaticGoogleMaps.ascx" TagName="GoogleMap" TagPrefix="cms" %>
<div class="whiteBox">
<div class="floatLeft">
<h3><%# Eval("OfficeName", true) %></h3>
<p class="address">
<%# IfEmpty(Eval("OfficeAddress1"), "", Eval("OfficeAddress1",true) + "<br />") %>
<%# IfEmpty(Eval("OfficeAddress2"), "", Eval("OfficeAddress2",true) + "<br />") %>
<%# IfEmpty(Eval("OfficeCity"), "", Eval("OfficeCity",true)) %>
<%# IfEmpty(Eval("OfficeState"), "", " " + Eval("OfficeState",true))%>
<%# IfEmpty(Eval("OfficeZIP"), "", " " + Eval("OfficeZIP",true) + "<br />")%>
<%# IfEmpty(Eval("OfficeCountry"), "", Eval("OfficeCountry",true))%>
</p>
<table>
<tr>
<td class="bold">Telephone:</td>
<td><%# IfEmpty(Eval("OfficePhone"), "-", Eval("OfficePhone",true))%></td>
</tr>
<tr>
<td class="bold">E-mail:</td>
<td><%# IfEmpty(Eval("OfficeEmail"), "-", Eval("OfficeEmail",true))%></td>
</tr>
</table>
</div>
<div class="floatRight">
<cms:GoogleMap runat="server" ID="GoogleMap" Scale="12" Width="298" Height="248" Longitude='<%# Eval("OfficeLongitude") %>' Latitude='<%# Eval("OfficeLatitude") %>'></cms:GoogleMap>
</div>
<div class="clear"></div>
</div>


On the bold lines you can see how to register a web part for use in transformation, and how to pass a parameter from the entry in repeater.

Reagards,

Josef Dvorak

User avatar
Member
Member
pavel.1991-tut - 10/18/2013 6:53:11 AM
   
RE:offices and google map web part
<cms:GoogleMap runat="server" ID="GoogleMap" Scale="12" Width="298" Height="248" 
Longitude='<%# Eval("OfficeLongitude") %>' Latitude='<%# Eval("OfficeLatitude") %>'>
</cms:GoogleMap>

this works if values of OfficeLongitude and OfficeLatitude are integer, but if it is float, it does not work. I mean, for example, 37 Longitude and 56 Latitude work, but 37.263124 Longitude фтв 56.892242 Latitude do not work. What is the matter?

User avatar
Kentico Legend
Kentico Legend
Brenden Kehren - 10/18/2013 7:50:25 AM
   
RE:offices and google map web part
The lat and long fields are double. You probably need to cast your results to a double like so
OfficeLongitude="<%# EvalDouble("OfficeLongitude") %>"

User avatar
Member
Member
pavel.1991-tut - 10/18/2013 7:56:02 AM
   
RE:offices and google map web part
Unfortunately it does not work either.

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 11/4/2013 9:00:56 AM
   
RE:offices and google map web part
Hello Pavel,

The fields in the Static Google maps web part are indeed of type Double. How does the problem manifest? Does the web part show any kind of error? Is there anything in the Event log?

Have you made any changes to the default web part? Can you post your entire transformation, so that I can see how you are using the web part?

Regards,
Josef Dvorak

User avatar
Member
Member
pavel.1991-tut - 11/28/2013 5:30:11 AM
   
RE:offices and google map web part
for example, this is my transformation:
<%@ Register Src="~/CMSWebParts/Maps/Static/StaticGoogleMaps.ascx" TagName="GoogleMap" TagPrefix="cms" %>
<div class="googleMap">
<cms:GoogleMap runat="server" ID="GoogleMap" Scale="10" Width="100%" Height="300" Longitude='-103.275147' Latitude='52.025459'></cms:GoogleMap>
</div>

If I write like this: Longitude='-103.275147' Latitude='52.025459' - it does not work. There is google map on the page, but it does not show the right place. But if I write like this Longitude='-103' Latitude='52' - it works! I see the right place.

User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 11/28/2013 7:44:46 AM
   
RE:offices and google map web part
Hello Pavel,

The markup you sent me is working correctly for me, using both double and integer value.

Is it possible someone has edited the web part control? Can you test installing clean Kentico website and using the same markup there?

Regards,
Josef Dvorak