Developer forum

Forum » Development » Maps Module.
Mikkel Toustrup Olsen
Reply

Hello,

I have sumpled accross a scenario which I havent found a solution for in the maps module itself..

I have created multiple gruoups and subgroups in the user management system, and have plotted location data for the subgroups. These a being perfecttly plotted when using the "show all groups" button when I use the regular maps.html template. However, even though it lists the the x-parentgroups as buttons as well, I am not able to click on any of these and see the single subgroup plotted in the map.. e.g.

  1. Seadepartment - has 4 subgroups all containing geolocations which are show perfectly when clicking "Show All Groups"
  2. Earthdepartment-  has 2 subgroups all containing geolocations which are show perfectly when clicking "Show All Groups" 

and so on....

however, when I click e.g. the "Seadepartment" button which is being created -> I cannot list the 4 subgroups which is the functionality I want in this particular instance..

I have thought of a custom razor/c# workaround and to extend the usermanagement to get the subgroups locations and by that plot the information to a new instance of the googlemaps api(not using the module though) - but I am pretty sure that it is possible to archieve with the module as it is, since I can see them plotted in the first place?..

Have a nice weekend,

/MikkelTO

 


Replies

 
Mikkel Ricky
Reply

Do you have a sample page we can take a look at?

 
Mikkel Toustrup Olsen
Reply

Hey Mikkel,

Sure: http://danishagro.net.dynamicweb-cms.com/frontpage-1?Purge=True

As I mention, it shows the groups correctly when Show All Groups button is clicked (ive set use only subgroups to true in the maps module atm) else it will not show any of the locations whatsoever.

Though I want the groups to be shown from each "department" when clicking their respective buttons.

Regards,

MikkelTO

 
Mikkel Ricky
Reply

If you take a look at the rendered html output (and I know you do), you'll notice that the template tag <!--@GroupIDList--> and the Groups loop has not been processed and therefore the markers on the map do not have any meaningful filter values defined.

The reason for this is that you're showing groups on the map and the groups do not have this information, but users do. Furthermore, GroupID is missing when rendering groups and that's a bug (or oversight) - I'll look into that.

If you're taking the Razor approach, you can still use the maps module JavaScript library. Just make sure that you render content similar to the content rendered by the Maps module template.

Best regards,
Mikkel

 

 
Mikkel Toustrup Olsen
Reply

Hey Mikkel,

Your post makes sense to me, however just to make sure I get it right. Even though a group (in user management) .- in my case a bunch of subgroups - has the the exact same fields availbale like a user(adress, zipcode etc.), they are not able to be shown/plotted as locations on the map, like a user would be.

I have no trouble by going a more custom razor/c# way and "extending" some of the methods- just wanted to make sure, that I'm not overlooking any functionality before spending time on writing custom code of course - which is why I asked in the first place :-)

I guess that most, if not all, values are able to be retrieved by the razor methods as well why I dont see any problem going down that path?

Redgards,

MikkelTO 

 

 
Mikkel Ricky
Reply

Both users and groups can be plotted on a map by the Maps module, but apart from the shared fields (address, zipcode etc.) some fields are only available on users and some only on groups.

The "out of the box" filterring in the Maps module uses group ids for filtering, but since the group id (or parent group id for that matter) is not available in the template, this built-in filtering does not work.

 
Mikkel Toustrup Olsen
Reply

Hey again Mikkel,

As far as I can see, the cshtml templates for the maps module are only available in 8.4 -> 

The solution I'm woking on atm are set at 8.2 which doesn't allow me to make use of this (via the maps module). Since it is a rather large project, I wont upgrade it just now - specially when I have no idea if this upgrade could influence other functionality througout the website.

Do you have any suggestions of a workaround in this matter - I was thinking of constructing a new google map, not by the module (in order to avoid the before-mentioned upgrade), but from their API as well (which is my guess themodule does as well?) and customize the razor into a paragraph template instead.

Regards,

MikkelTO

 
Mikkel Ricky
Reply

My only suggestion is that you make sure to generate output that is like the one the Maps module generates (apart from the Group ID), and then reuse the Maps module JavaScript library. This can easily be done in a Razor based paragraph template.

Best regards,
Mikkel

 

You must be logged in to post in the forum