-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
794bb69
commit 6e5eb2e
Showing
13 changed files
with
488,464 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
{% block api %} | ||
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDpBiWzKU1WaL6QeiDenEPNp0UQhLsLnXs&sensor=false&libraries=visualization"></script> | ||
|
||
{% endblock api %} | ||
|
||
{% block init_map %} | ||
<script type="text/javascript" src="http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"></script> | ||
<script type="text/javascript"> | ||
|
||
var heatmap; | ||
|
||
var map; | ||
|
||
var heat_data; | ||
|
||
// window.onload = function() { | ||
function initialize() { | ||
var lat_long = new google.maps.LatLng({{latitude}}, {{longitude}}); | ||
var mapOptions = { | ||
center: lat_long, | ||
zoom: {{zoom}}, | ||
mapTypeId: google.maps.MapTypeId.{{map_type}} | ||
}; | ||
|
||
map = new google.maps.Map(document.getElementById("{{ html_id }}"), mapOptions); | ||
|
||
var kml = "{{ kml }}" | ||
|
||
myParser = new geoXML3.parser({map: map}); | ||
myParser.parse(kml); | ||
|
||
heat_data = [] | ||
{% if data %} | ||
|
||
function createMarker(latitude, longitude, string, icon, image) { | ||
var marker = new google.maps.Marker({ | ||
position: new google.maps.LatLng(latitude, longitude), | ||
map: map, | ||
icon: icon, | ||
animation: google.maps.Animation.DROP, | ||
}) | ||
var contentString = string; | ||
|
||
if (image != "") { | ||
contentString = '<IMG BORDER="0" ALIGN="Left" SRC=' + image + '>' + contentString | ||
} | ||
|
||
var infoWindow = new google.maps.InfoWindow({ | ||
content: contentString | ||
}); | ||
|
||
google.maps.event.addListener(marker, 'click', function() { | ||
infoWindow.open(map,marker); | ||
}); | ||
} | ||
|
||
{% for p in data %} | ||
|
||
createMarker({{p.latitude}},{{p.longitude}}, "{{p.title|escapejs}}", "{{p.icon}}", "{{p.image}}"); | ||
|
||
var item = new google.maps.LatLng({{p.latitude}}, {{p.longitude}}); | ||
heat_data.push(item); | ||
|
||
{% endfor %} | ||
|
||
var pointArray = new google.maps.MVCArray(heat_data); | ||
|
||
|
||
|
||
{% endif %} | ||
|
||
|
||
} | ||
google.maps.event.addDomListener(window, 'load', initialize); | ||
|
||
</script> | ||
{% endblock init_map %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from django import template | ||
|
||
register = template.Library() | ||
|
||
@register.inclusion_tag('gmap/map_sentiment.html') | ||
|
||
def gmap_sentiment(html_id, latitude, longitude, kml, **kwargs): | ||
""" | ||
{% gmap <html_id> <latitude> <longitude> [zoom=<zoom>] [map_type=<map_type>] | ||
[data=[<map_data>] %} | ||
""" | ||
zoom = kwargs.get('zoom', 15) | ||
map_type = kwargs.get('map_type', 'ROADMAP') | ||
m_data = kwargs.get('data') | ||
data = { | ||
'html_id': html_id, | ||
'latitude': latitude, | ||
'longitude': longitude, | ||
'zoom': zoom, | ||
'map_type': map_type, | ||
'kml': kml | ||
} | ||
|
||
if m_data: | ||
data['data'] = m_data | ||
|
||
return data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ static==1.0.2 | |
tweepy==2.2 | ||
wsgiref==0.1.2 | ||
nltk==2.0.4 | ||
facepy==0.9.0 |
Oops, something went wrong.