Does GoogleMap control support SSL?

May 3, 2011 at 8:00 PM

I have looked through the Discussions, the Documentation and the Issues to see if there is anything about SSL support, as my web site lives in a secure environment, though it does not require a login to be accessed.  IE displays a wonderful security popup with the load and with every post back.  I can only find one discussion thread asking about this with no responses.  Is there a way to allow connecting over SSL with the Artem GoogleMap control?  Thanks.

May 4, 2011 at 4:51 PM

I haven't tested it yet, but I think I found the solution to my problem.  I had to install VS 2010, as my projects are currently in VS2008, but I needed to do that anyway.  I am using Artem GoogleMap control v5.  Anyway, in GoogleMap.Render.cs, I set the MapsApiUrl = "https://maps-api-ssl.google.com/maps/api/js?", which is the secure google maps url, rather than the base "http://maps.google.com...".  Then I rebuilt the project and have inserted the new Artem.Google.dll into my application.  I feel confident that this will work, but as I said, I have not tested it yet.  In my dev environment it works, but I do not go through a secure proxy in dev, so it is not an accurate test.

Jun 14, 2011 at 1:05 PM

Hi.

How do I access MapsApiUrl?
I can't see it as a property of the control (GoogleMap1)?

 

Thanks.

Jun 14, 2011 at 2:44 PM

I meant to reply sooner. What I described above worked.

 

etheridge --> It is in the source code for the GoogleMap control. It is not a property of the control. In the code file mentioned in my previous post, you can set the MapsApiUrl to point to the SSL version of the API. Then recompile and use the newly compiled DLL. If you are needing to use SSL, then until someone else informs me of a property I haven't found for it, my solution is the only way I know of.  Good luck.

Sep 20, 2011 at 11:52 PM

jbrook19 you mention you are using V5 of the control.. where did you get it? I only see V4.1 released?

Sep 26, 2011 at 4:49 PM

Sorry for the delayed response, but I was out of the office last week.  Anyway, here is the link, assuming I copied the correct one:

http://googlemap.codeplex.com/releases/view/35430

However, if you click on the Downloads tab above, look on the right side of the page that loads, in the "Other Downloads" box.  The 5.0 version of the control should be at the top of that list.  I believe it is technically still in beta, but I have found no issues with it yet, and it has been out for a good while now.  Of course, my implementation is very basic.  It is just a simple map to display simple points out of my database on a map.

Enjoy and good luck.

Oct 6, 2011 at 5:04 PM

The original post says to edit the code for the control and change the address of the google map API.

However the V5 you mention (and the link) is only for the binary download, not the source.

Is there is a interface / config option to set the address of the URL at runtime ?

Oct 6, 2011 at 5:28 PM

Click on the Source Code tab above.  The change set that I used appears to be 73320.  There is a new build since I did my work on it, so you may want to use the latest change set, which appears to be 78642, as of writing this.  Anyway, you will need to click on the change set number on the left side.  I did not want to check my changes in, as they were specific to my environment, and were not material to the project as a whole, so I did not attach to the Team Server.  I worked offline, which was what I wanted.  Anyway, that should get you the source code and what you need to move forward.

There is no ability to set the URL at runtime that I could find, which is why I modified the code to do it.  That is all I did to mofiy the code.  I strongly advise against signing into the Team Server for the project and checking that change in, unless the team in charge of this project wants that done.

Oct 6, 2011 at 6:08 PM

ya I wont check it in.. I will do it just for my setup no problem.

Ok I will download the changeset 73320 , and try to switch MapsApiUrl in GoogleMap.Render.cs as above.. wish me luck :)

Oct 6, 2011 at 8:27 PM

well that didnt work :(

I made the change to the binary in google.render.cs which is in the \ui dir. This was the change:

 

#region Static Fields 
public static readonly string MapsApiUrl = "https://maps-api-ssl.google.com/maps/api/js?";

     
When I then load a test page with this updated binary.. it works correct in a http: session.. however in a https session the map never loads.

Oct 6, 2011 at 8:38 PM

This may be a silly question, but I want to cover all of the bases.  Did you rebuild the GoogleMap control?  That will create a new GoogleMap dll file (the name be a little different).  Once the new dll is copied into your project you would then have to rebuild your application/site with the new DLL.  Did you also do that?

Oct 6, 2011 at 8:46 PM

Here is the actions I took:

  1. I opened up the changelist (googlemap-73320.zip) and opened up the artmem project (googlemap-73320\Work\GoogleMapControl)
  2. I opened the project in Vs2010, found the file and made the edit described above
  3. I also changed the product version of the Dll (properties), I added "ssl" to the version string so I could verify I was running with my modified version
  4. Did a full batch rebuild (all flavors)
  5. Copied the new artem.google.dll from googlemap-73320\Work\GoogleMapControl\Artem.GoogleMap\bin\Debug into my asp.net project
  6. rebuild my project
  7. ran the project locally (no SSL) to verify it worked
  8. Uploaded the project to my webserver
  9. Tested it as http == works
  10. Tested it as https == doesnt work
Oct 6, 2011 at 8:58 PM

Ok I think I got this fixed, I need to do some more testing first.

It looks like the https loading was misconfigured on the WS (test domain / vs real domain).. right now it's working on a super basic test page.

 

I

Oct 6, 2011 at 9:00 PM

What you just described is basically what I did and it worked perfectly for me.  My test and prod sites go through a secure proxy, which is why I had to use the https version of the Google Map control.  In my dev environment, which is not secure it worked fine, but when I deployed to test, it failed.  Then I did what I described above, rebuilt the Artem control, copied the DLL into my project, rebuilt my project and all versions worked and still do.  I really don't know what may be missed in your step-by-step process above.

Here is a link to my implementation of the map service, for what it's worth:  https://myalaska.state.ak.us/dec/air/airtoolsweb/Advisories.aspx

The SSL connection is not relevant in any of my code, as the Artem control has not property or method referring to it.  It does not know that it is secure or not.  Hmmm...

Oct 7, 2011 at 5:51 PM

Confirmed that the fix DOES work, the earlier problem I reported was due to a miss config on my webserver (not related to the control).

To support SSL you need to make the code change as noted above (thanks jbrooke19).

 

-Jeff

Coordinator
Oct 7, 2011 at 7:30 PM

Hi guys,

I am a little bit late to this diescussion of yours.
So, if I get the problem right, when you use the control under SSL pages it needs to load the GoogleMaps API scripts from the SSL URL as well.
I will add that feature to the new release 5.0.
I'm going to add a code to automatically detect when the request is under SSL and will switch to loading the GoogleMaps API over HTTPS.

If there are any cases in which you need the switch to SSL to be controled by a control property instead, please let me know and I will add a property too.

Regards

Oct 7, 2011 at 10:49 PM

Hey velio, yes the scenario is that the map control is being used on a SSL page. To maintain the SSL state everything on the page must be loaded from https which includes the map.

If the control could auto detect that would be awesome, very much appreciated.