Пример #1
0
    def GET(self):
        web.header('Content-Type', "text/javascript; charset=utf-8")
        input = web.input("sw", "ne", "zoom");
        bounds = handler.validBounds(input.sw, input.ne)
        zoom = handler.validN(input.zoom)

        model = mapper.getClusterModel(handler.filteredAnalyses(web),
                zoom, bounds)
        MapFormatter.enhanceClusterModel(model)
        dumpJson(model)
Пример #2
0
    def GET(self):
        sight = None
        input = web.input()
        homeUrl = input.get("byt")
        if homeUrl:
            homeUrl = homeUrl.replace(" ", "+")
            analyses = handler.filteredAnalyses(web)
            for analysis in analyses:
                if analysis["url"] == homeUrl:
                    sight = MapFormatter.createSight(analysis)
                    break
            else:
                logging.info("No such home: %r", homeUrl)

        print formatter.page("map", _(u"Map of Prague homes"),
                type="withFilter toggleFilter")(
                        config.MAP_KEY, locality.GEO_BOUNDS, sight)