mirror of https://github.com/interlegis/sigi.git
Sesostris Vieira
12 years ago
6 changed files with 5677 additions and 2 deletions
File diff suppressed because it is too large
After Width: | Height: | Size: 386 B |
@ -0,0 +1,54 @@ |
|||||
|
{% extends "admin/index.html" %} |
||||
|
{% load adminmedia %} |
||||
|
|
||||
|
{% block title %}SIGI{% endblock %} |
||||
|
|
||||
|
{% block extrahead %} |
||||
|
{{ block.super }} |
||||
|
<script type="text/javascript" src="{% admin_media_prefix %}js/core.js"></script> |
||||
|
<script type="text/javascript" src="{% admin_media_prefix %}js/jquery.min.js"></script> |
||||
|
<script type="text/javascript" src="{% admin_media_prefix %}js/jquery.init.js"></script> |
||||
|
<script type="text/javascript" src="https://maps.google.com/maps/api/js?sensor=false"> </script> |
||||
|
<script type="text/javascript"> |
||||
|
(function($) { |
||||
|
$(document).ready(function($) { |
||||
|
var latlng = new google.maps.LatLng(-14.2350040, -51.925280); |
||||
|
var myOptions = { |
||||
|
zoom: 5, |
||||
|
center: latlng, |
||||
|
mapTypeId: google.maps.MapTypeId.ROADMAP |
||||
|
}; |
||||
|
|
||||
|
var map = new google.maps.Map(document.getElementById("map"), |
||||
|
myOptions); |
||||
|
|
||||
|
$.get("/sigi/diagnosticos/mundiagjson/", function(municipios) { |
||||
|
for (var i in municipios) { |
||||
|
var municipio = municipios[i]; |
||||
|
var markData = { |
||||
|
map: map, |
||||
|
position: new google.maps.LatLng(municipio.lat, municipio.lng), |
||||
|
title: municipio.nome, |
||||
|
icon: '{{ MEDIA_URL }}images/mapmarker.png' //'/sigi/media/images/mapmarker.png' |
||||
|
} |
||||
|
var mark = new google.maps.Marker(markData); |
||||
|
var infoWin = new google.maps.InfoWindow({content: |
||||
|
'<strong>' + municipio.nome + '</strong><br/>' + |
||||
|
'<strong>Início da visita:</strong><br/>' + municipio.inicio + '<br/>' + |
||||
|
'<strong>Término da visita:</strong><br/>' + municipio.fim + '<br/>' + |
||||
|
'<strong>Equipe:</trong><br/>' + municipio.equipe }); |
||||
|
linkMarkMessage(mark, infoWin, map); |
||||
|
} |
||||
|
}); |
||||
|
|
||||
|
function linkMarkMessage(mark, infoWin, map) { |
||||
|
google.maps.event.addListener(mark, 'click', function() { |
||||
|
infoWin.open(map, mark);}); |
||||
|
} |
||||
|
})})(django.jQuery); |
||||
|
</script> |
||||
|
{% endblock %} |
||||
|
|
||||
|
{% block content %} |
||||
|
<div id="map" style="width:100%; height: 800px; float: left;"></div> |
||||
|
{% endblock %} |
Loading…
Reference in new issue