Adding markers to Google Maps Module

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/7/2011 11:59:15 AM
Gravatar
Total Posts 22

Adding markers to Google Maps Module

Hi,

Im currently trying to extend the Google Maps Module to allow me add markers to a map based on a list of objects with longitude and latitude values. 

I have copied the Google Maps module to prevents forks in the code and I have added a function, CreateMapandMarkers to mojogmaputils3.js to create a map and add a marker for each object.

I have added a list property to LocationMap.cs which I assign the list of objects to during PageLoad() of GoogleMapModule. I then have access to my list in LocationMap.cs PreRender when I add the script to the page to call my js function CreateMapandMarkers.

The problem I am having is passing the list of objects to my function CreateMapandMarkers. My javascript is not very good so im hoping someone with more knowledge than me might be able to help out.

I could just create one long script within LocationMap.cs which creates the map and adds the markers but I would prefer the cleaner option of passing the list to the javascript function.

Any help or suggestions would be greatly appreciated

10/7/2011 12:07:42 PM
Gravatar
Total Posts 18439

Re: Adding markers to Google Maps Module

Hi,

I can't offer advice on all that you are trying to do, but if you cloned the feature to avoid forking you should also have cloned the mojogmaputils3.js into a new file with a different name and then change your code to reference the new file and use a different key when registering the script. Otherwise if you modify the mojogmaputils3.js you are forking that file and possibly breaking the built in google map and if you upgrade the file will be replaced by the original, so a clone should not have any files in common with the original feature.

Maybe someone else here can offer more help with extending the map functionality, or there are probably lots of tutorials or example code to be found by googling.

Hope that helps,

Joe

10/7/2011 2:28:38 PM
Gravatar
Total Posts 22

Re: Adding markers to Google Maps Module

Cheers Joe, Thanks a mil for the quick response. I have copied the mojogmaputils.js file and use that to prevent forking.

There are loads of tutorials on line for the google maps side of things but I can't find an example of passing a list of objects to a function in javacript and as I said my javasript skills are pretty limited. Im sure with some time googling il fiind something or if anyone else has a suggestion it will be a great help.

Thanks again for the quick reply

Keith

10/8/2011 4:09:01 AM
Gravatar
Total Posts 39
Hello from France!

Re: Adding markers to Google Maps Module

Hi,

I'm starting a new site on the deportation during the Second World War (1940-1945)
A page should display the list of deportees in a particular region of France.
When selecting a person, you reach the information sheet.
The information sheet should display a Google map with the city of birth, city of arrest and the cities of the camps where the person has gone.
To do this, I'm writing a new custom module in mojoPortal
Latitude and longitude are placed in a SQL table 'Ville' (or 'Town').
I used the library GoogleMap Control (http://googlemap.codeplex.com/) = Artem Googlemap version 4.1.0.0.
This version uses the old version 2 of Google Map API, but it works well.
If you want to see the result of my firsts developments:
Url: www.memoire-deportation-ain.fr
user: mojoguest@esoft-studio.fr, pass: mojoguest
Then navigate on 'Rechercher une personne', write 'LETH' (or other part of name) in the TextBox and click on 'Rechercher par nom'.

You will see a list who match with this part of name.
Click on one of these 2 persons and you will see the Google map with customs markers
You will find informations on this GoogleMap control on the net.
All you have to do is to place Artem.GoogleMap.dll in the /bin folder, and after, you can 'play' with Artem.Web.UI.Controls in your code (VB or C#)!
If you need more infos, you can ask me.

Best regards

Christian

10/9/2011 8:34:00 AM
Gravatar
Total Posts 22

Re: Adding markers to Google Maps Module

Hi Christian,

Thanks a mil for your suggestion. I had looked at 2 other controls I found online but found them to be flakey so decided it would be easier to modify the existing mojo module. I havn't looked at that control properly but it looks like it will do everything I need. I will spend some time tomorrow investigating and if I any questions I will let you know.

Thanks again for your help

Keith

2/10/2012 5:44:08 AM
Gravatar
Total Posts 1

Re: Adding markers to Google Maps Module

I am using Artem Google map ApI version 4.1.0.0 .I am adding markers from server side and on click redirecting to a page.when marker is clicked info window is shown. I do not want to show infowindow at any time .By default it should not show. Kindly i need quick response

You must sign in to post in the forums. This thread is closed to new posts.