FORUMS

c360 Forums
 Home        Members    Calendar    Who's On

Welcome Guest ( Login | Register )
      



Google mapExpand / Collapse
Message
Posted 10/2/2006 10:16:27 PMPost #654
 

c360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guru
Overview

The goal of this sample is to display a map of the area where an account or contact is located. Also, in the case of an order, we want to display directions to get to the delivery destination. (Please note that the starting address for the directions has be set to c360 Solutions' main office in Atlanta, but feel free to change it to your own address).

This sample demonstrates the following:

  • Fetch data about the current account or order
  • Redirect the user to Google map and pass the information expected by Google in order to be able to display a map

Installation

Step 1 – Edit ISV.config

This sample must be added as a new link on the left navigation bar of the Microsoft CRM account edit screen and the order edit screen as well. Therefore we need to edit the “account” and the “salesorder” entity sections in Microsoft CRM’s ISV.config file like so:

<ENTITY name="account">

   <NAVBAR ValidForUpdate="1" ValidForCreate="0">

      <NAVBARITEM id=googleMap

       title="Google map"

       Url="http://localhost:4589/c360Sdk/Samples/GoogleMap/GoogleMap.aspx"

       Icon="http://localhost:4589/c360Sdk/Samples/GoogleMap/GoogleMap.jpg" />

   </NAVBAR>

</ENTITY>

<ENTITY name="salesorder">

   <NAVBAR ValidForUpdate="1" ValidForCreate="0">

      <NAVBARITEM id=googleMap

       title="Google map"

       Url="http://localhost:4589/c360Sdk/Samples/GoogleMap/GoogleMap.aspx"

       Icon="http://localhost:4589/c360Sdk/Samples/GoogleMap/GoogleMap.jpg" />

   </NAVBAR>

</ENTITY>

Note: you will need to adjust the url in the above sample to match your environment.

Step 2 – Copy files

In your Visual Studio 2005 project, make sure you have a folder called “Samples” and create a sub-folder called “GoogleMap”. In this new folder, copy the image, the ASPX page and it’s corresponding code behind file:

  • GoogleMap.jpg
  • GoogleMap.aspx
  • GoogleMap.aspx.cs

Screenshots



 

  Post Attachments 
GoogleMap.zip (227 views, 2.13 KB)

Posted 10/3/2006 10:15:05 AMPost #660
 

c360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expert
Funny, I came across something simular for Virtual Earth yesterday... So I created a sample like Jeremie's GoogleMap sample but one that uses the Virtual Earth's MapControl

http://dev.live.com/virtualearth/sdk/



  Post Attachments 
VirtualEarth.zip (196 views, 3.02 KB)

Posted 10/3/2006 10:19:37 AMPost #661
 

c360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expert
About the Virtual Earth Sample:

For creating the mapcontrol I would like to call the getMap() method in the onload event of the body of the aspx page.
(I now have to use a button to accomplish this...)

It seems as if the onload property is removed by the AreaPage when the c360BaseForm is created...

Why this is happening...?
Posted 10/8/2006 10:30:15 PMPost #677
 

c360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guru
You can add the following line of code to execute the get map when the page loads:

Instance.RegisterClientScriptBlock("window.onload", "function window.onload() { getMap(); }");

By the way, with your permission, I would like to include this sample you created in the next version of the SDK. Let me know if you agree.
 

 

Posted 10/9/2006 5:29:37 AMPost #678
 

c360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expert
Jeremie Desautels (10/8/2006)

Instance.RegisterClientScriptBlock("window.onload", "function window.onload() { getMap(); }");

Tried several possible workarounds, but this one might do the trick.
Will give it a try.
Thanx.

Jeremie Desautels (10/8/2006)
By the way, with your permission, I would like to include this sample you created in the next version of the SDK. Let me know if you agree.
 

Put me in the credit and you have my GO!

side note: I was looking at Virtual Earth because Google Maps could not calculate a correct (detailed) route between locations in the Netherlands. But I it seems that on october 4 2006 an updated version of Google Maps for the Netherlands was released that fixes this:   http://www.google.nl/maps  
Posted 10/9/2006 2:35:18 PMPost #679
 

c360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guruc360 Product Guru
Thanks. your sample will be included in the next release of the SDK along with the others I posted in the last couple days. Of course, you get full credit

 

« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: kanika.jackson, Ken Champion

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 3:07pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 4.469. 14 queries. Compression Enabled.