Developer forum

Forum » Development » Application/json and Maps module

Application/json and Maps module

Rasmus Andersen
Reply

Hi DW, 

I just tried to create some JSON using the Maps module, primarily to get the right context (user group). When selecting application/json in the layout and adding a blank layout the Maps module will inject a script in the bottom of the page, making the JSON invalid. 

<script type='text/javascript'>/*<![CDATA[*/(function() {var options = {elementId: 'Maps-36',map: {elementId: 'Maps-36-map',center: [ 0.000000, 0.000000 ],zoom: 4,mapType: 'ROADMAP'},marker: {showInfoWindowAction: 'click'},infoWindow: {},list: {elementId: 'Maps-36-list',showInfoWindowAction: false,showInfoWindowZoom: 0},clusterer: {styles: [],gridSize: 0,enabled: false}};new Dynamicweb.Map(options);}())/*]]>*/</script>

I guess this is a bug, so for now I found another solution. 
I would also like to reccomed implementing a user group selector for items, as this would have prevented me from looking at the maps module in the first place. 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Rasmus

Yes, that is bad module design from our side. Unfortunately it is difficult to fix without breaking existing solutions. Glad you found a workaround.

I've added user group selector field type for items as a feature for 8.7.1

BR Nicolai

Votes for this answer: 1
 
Rasmus Andersen
Reply

Hi Nicolai, 

Thank you for reacting quickly, we're looking forward to using the user group selector from our items :) 

 

You must be logged in to post in the forum