On the frontend I'm using the HTML helper and the model that is coming from the published content looks right. The code is on the page but the map doesn't render. Everything seems to work ok on the backend. I'm using the package on Umbraco 7.10.4.
I can see your trying to render a Google Map using Terratype version 1.0.17, can you say what browser you are using and have you tried in other browsers?
Also is there any console errors ?
If you are able to, can you launch Developer Tools (Press F12 in Chrome for example) and see if
Has any children elements? (If the map is loading there should be hundreds of new DOM elements within).
Things to note: Once the map has successfully loaded that <div> should have a style of 'Opacity:1' and its parent <div> should be 'display:block'. If there is something in the javascript failing, then the block will stay hidden.
Cheers
Jonathan
EDIT: I note as I was writing this reply that you have already replied yourself. I will leave my answer up, for anyone else that might have your issue and it might offer some direction.
Thanks Jonathan, that pointed me into the right direction. The issue is that I'm using Vuejs to render a component. That component takes the rendered Razor template using ajax and inject it into the component's template.
So at this point the markup is there but I'll have to trigger the initialisation of the map manually after the DOM is loaded. Is there anyway I can reload the map?
Thanks for the info. In my case I had to include the scripts on the main layout as the html coming from the server is just html and the <script> tags that Terratype creates are not executed and no scripts is loaded.
As a suggestion, and for this case, it would be nice to have an option on the Html helper to not render the scripts ;)
Map doesn't display on frontend
On the frontend I'm using the HTML helper and the model that is coming from the published content looks right. The code is on the page but the map doesn't render. Everything seems to work ok on the backend. I'm using the package on Umbraco 7.10.4.
The height of the Terratype container is 0.
This is what is generated on code:
Sorry, I think it's something with my code. If I remove the layout and keep the map in its own view it works ok.
Hi Mario,
I can see your trying to render a Google Map using Terratype version 1.0.17, can you say what browser you are using and have you tried in other browsers?
Also is there any console errors ?
If you are able to, can you launch Developer Tools (Press F12 in Chrome for example) and see if
Has any children elements? (If the map is loading there should be hundreds of new DOM elements within).
Things to note: Once the map has successfully loaded that <div> should have a style of 'Opacity:1' and its parent <div> should be 'display:block'. If there is something in the javascript failing, then the block will stay hidden.
Cheers
Jonathan
EDIT: I note as I was writing this reply that you have already replied yourself. I will leave my answer up, for anyone else that might have your issue and it might offer some direction.
Thanks Jonathan, that pointed me into the right direction. The issue is that I'm using Vuejs to render a component. That component takes the rendered Razor template using ajax and inject it into the component's template.
So at this point the markup is there but I'll have to trigger the initialisation of the map manually after the DOM is loaded. Is there anyway I can reload the map?
Could I use something like?:
If so, which would be the map...?
Thanks.
Hi Mario,
There is some code you can call just for this purpose
It can only be called after the DOM elements of Terratype have loaded.
or if you wish call
in your own js code, when you require the maps to be initialised.
You can find more info about the javascript framework built into Terratype in the manual, in the section called 'Javascript events'
Cheers
Jonathan
Thanks for the info. In my case I had to include the scripts on the main layout as the html coming from the server is just html and the
<script>
tags that Terratype creates are not executed and no scripts is loaded.As a suggestion, and for this case, it would be nice to have an option on the Html helper to not render the scripts ;)
thanks man.
is working on a reply...