Skip to content

Migrate write_heatmap #6

@enriqueav

Description

@enriqueav
    def draw(self, htmlfile, img_path=None, header=None, footer=None):
        """Create the html file which include one google map and all points and paths. If
        no string is provided, return the raw html.
        """
        f = open(htmlfile, 'w')
        f.write('<html>\n')
        f.write('<head>\n')
        f.write(
            '<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" '
            'integrity="sha512-puBpdR0798OZvTTbP4A8Ix/l+A4dHDD0DGqYW6RQ+9jxkRFclaxxQb/SJAWZfWAkuyeQUytO7+7N4QKrDh+drA==" '
            'crossorigin=""/>\n')
        f.write(
            '<script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"'
            'integrity="sha512-nMMmRyTVoLYqjP9hrbed9S+FzjZHW5gY1TWCHA5ckwXZBadntCNs8kEqAWdrb9O7rxbCaA4lKTIWjDXZxflOcA=="'
            'crossorigin=""></script>'
        )
        f.write(
            '<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>\n')
        f.write('<title>Leaflet - llplot </title>\n')
        # if self.apikey:
        #     f.write('<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=true_or_false&key=%s"></script>\n' % self.apikey )
        # else:
        #     f.write('<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=visualization&sensor=true_or_false"></script>\n' )
        f.write('<script type="text/javascript">\n')
        f.write('\tvar llMap;\n')
        f.write('\tfunction initialize() {\n')
        self.write_map(f)
        # self.write_grids(f)
        self.write_points(f)
        self.write_paths(f)
        # self.write_circles(f)
        # self.write_symbols(f)
        # self.write_shapes(f)
        # self.write_heatmap(f)
        # self.write_ground_overlay(f)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions