I can see what you are trying to achieve, but to render, Terratype needs loads more info like what type of map to render, api keys, styling etc, this is done when you create a new datatype. Without this @Html.Terratype() has no idea whether you want a blue and green Bing Map showing latest traffic or a dusty coloured Google Map just showing Terrain and no roads.
So right now, sadly you do need to create content, you only need one though, as you can set the position of the map yourself in your razor template. Can I suggest a setting node, or a site node.
Being able to render maps without content isn't something I'm planning to write, as it would be a lot of work for me, for very little value.
Technical reason: Right now the config code is in javascript and sets a json block that the renderer reads, again all in javascript code. So the creating and rendering of maps is actually all done in js code, (Also as you already know, GMaps, Bing maps etc, are actually just js libraries, so really its all done using js code) not in c# code. Currently there is a subset of values you can set, called Options, to override those json values, which is managed in c# classes that map to json values. To be able to create your own map from scratch, I would need to create c# classes for all aspects of the configuration of a map, this would include styling which if you every take a look at will boggle the mind to its complexity. This would be a major undertaking. Sorry.
Cant create instance of Terratype.Models.Model
Hi comunity,
I am trying to render google map without placed it into Content.
In other words, I get the data of this map from another source in Json as string, like:
So, for render map i use below code:
And gets the error
Terratype version 1.0.14
Umbraco version 7.7.3
Hi Ivan,
I can see what you are trying to achieve, but to render, Terratype needs loads more info like what type of map to render, api keys, styling etc, this is done when you create a new datatype. Without this @Html.Terratype() has no idea whether you want a blue and green Bing Map showing latest traffic or a dusty coloured Google Map just showing Terrain and no roads.
So right now, sadly you do need to create content, you only need one though, as you can set the position of the map yourself in your razor template. Can I suggest a setting node, or a site node.
Being able to render maps without content isn't something I'm planning to write, as it would be a lot of work for me, for very little value.
Technical reason: Right now the config code is in javascript and sets a json block that the renderer reads, again all in javascript code. So the creating and rendering of maps is actually all done in js code, (Also as you already know, GMaps, Bing maps etc, are actually just js libraries, so really its all done using js code) not in c# code. Currently there is a subset of values you can set, called Options, to override those json values, which is managed in c# classes that map to json values. To be able to create your own map from scratch, I would need to create c# classes for all aspects of the configuration of a map, this would include styling which if you every take a look at will boggle the mind to its complexity. This would be a major undertaking. Sorry.
Cheers
Jonathan
is working on a reply...