gmplot icon indicating copy to clipboard operation
gmplot copied to clipboard

Render as URI

Open anushkrishnav opened this issue 5 years ago • 5 comments

Is there a function to render the map as a uri instead of a html file . I want to share my map inside a frame but I am unable to do that .Here is the example of how it can be implemented map.py

@blueprint.route('/map')
def map():
    gmap = gmplot.GoogleMapPlotter.from_geocode( "delhi, India",apikey="key")
    gmap.render_as_uri()
    return render_template('map/map.html',gmap=gmap)

map.html

{% extends "layouts/layout.html" %}

{% block header %}
<div class="container" align="left">
    <embed type="image/svg+xml" src={{gmap|safe}} style='max-width:1000px'/>
</div>
{% endblock %}

{% block content %}

{% endblock %}

anushkrishnav avatar Aug 13 '20 15:08 anushkrishnav

Not yet, but good idea!

frslm avatar Aug 15 '20 19:08 frslm

With some help and guidance I would love to work on this.

anushkrishnav avatar Aug 17 '20 07:08 anushkrishnav

I'd personally explore Google Maps Embed API and/or how Folium achieves this (a quick search points to this SO thread, which may or may not be useful).

frslm avatar Aug 20 '20 00:08 frslm

I'd personally explore Google Maps Embed API and/or how Folium achieves this (a quick search points to this SO thread, which may or may not be useful).

Okay, I am working on the feature. Is there any contribution guidelines? The embed is a good way to achieve what I need but the folium one doesn't work that much since we are still forced to create an HTML file dynamically.

anushkrishnav avatar Aug 20 '20 05:08 anushkrishnav

There are no contribution guidelines specific to this project, but you can fall back to Github's community guidelines. For any technical questions, you could note them in your PR and they can be addressed during the review.

frslm avatar Aug 21 '20 00:08 frslm