Add zoom support for embedded maps.

Add new url to embedded maps
This commit is contained in:
Paulo Gustavo Veiga
2012-06-03 20:23:31 -03:00
parent 3907e04ff6
commit 88b0efa859
20 changed files with 134 additions and 277 deletions

View File

@@ -23,6 +23,13 @@ import java.util.List;
@Controller
public class MindmapController {
private String baseUrl;
MindmapController() {
}
@Autowired
private MindmapService mindmapService;
@@ -100,6 +107,17 @@ public class MindmapController {
return view;
}
@RequestMapping(value = "maps/{id}/embed")
public ModelAndView embeddedView(@PathVariable int id, @RequestParam(required = false) Float zoom, @NotNull HttpServletRequest request) {
ModelAndView view;
final UserAgent userAgent = UserAgent.create(request);
final MindMap mindmap = mindmapService.getMindmapById(id);
view = new ModelAndView("mindmapEmbedded", "mindmap", mindmap);
view.addObject("user", Utils.getUser());
view.addObject("zoom", zoom == null ? 1 : zoom);
return view;
}
@RequestMapping(value = "collaborator")
public ModelAndView showCollaborator(@RequestParam(required = true) long mapId) {
final MindMapBean modelObject = findMindmapBean(mapId);