mapa en modal

parent fde6c900
...@@ -5,15 +5,18 @@ ...@@ -5,15 +5,18 @@
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"/>
<script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script> <script type="text/javascript" src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css" type="text/css"> <link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css"
type="text/css">
<style> <style>
.map { .map {
height: 400px; height: 400px;
width: 100%; width: 100%;
} }
</style> </style>
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script> <script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
<link rel="stylesheet" href="https://openlayers.org/en/v5.3.0/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"></script>
{% endblock %} {% endblock %}
{% block messages %} {% block messages %}
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
...@@ -65,7 +68,7 @@ ...@@ -65,7 +68,7 @@
<li> <li>
<!-- inner menu: contains the actual data --> <!-- inner menu: contains the actual data -->
<ul class="menu"> <ul class="menu">
<li> <li>
<a href="#"> <a href="#">
<i class="fa fa-productList text-aqua"></i> 5 new members joined today <i class="fa fa-productList text-aqua"></i> 5 new members joined today
</a> </a>
...@@ -156,7 +159,7 @@ ...@@ -156,7 +159,7 @@
{% for product in productList %} {% for product in productList %}
<tr> <tr>
<td><a href="#" <td><a href="#"
onclick="showMyModalSetTitle('{{ product.search_name }}', 'Some body txt')"> {{ product.search_name }}</a> onclick="showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"> {{ product.search_name }}</a>
</td> </td>
<td>{{ product.process }}</td> <td>{{ product.process }}</td>
<td>{{ product.purchase_date }}</td> <td>{{ product.purchase_date }}</td>
...@@ -271,14 +274,20 @@ ...@@ -271,14 +274,20 @@
function showMyModalSetTitle(name,data) { function showMyModalSetTitle(name,data) {
$('#map').empty(); $('#map').empty();
$('#myModalTitle').val(name); $('#myModalTitle').append(name);
$("#mapmodal").modal(); $("#mapmodal").modal();
setTimeout(function(){ createmap(); }, 1000);
setTimeout(function () {
createmap(data);
}, 1000);
//console.log(data)
} }
function createmap() {
var map = new ol.Map({ function createmap(data) {
/*var map = new ol.Map({
target: 'map', target: 'map',
layers: [ layers: [
new ol.layer.Tile({ new ol.layer.Tile({
...@@ -286,10 +295,39 @@ ...@@ -286,10 +295,39 @@
}) })
], ],
view: new ol.View({ view: new ol.View({
center: ol.proj.fromLonLat([-89.63873079999999,21.0404457]), center: ol.proj.fromLonLat([-89.63873079999999, 21.0404457]),
zoom: 5 zoom: 5
}) })
});*/
var raster = new ol.layer.Tile({
source: new ol.source.OSM()
}); });
var format = new ol.format.WKT();
/*var feature = format.readFeature(
'POLYGON((-103.22252457031466 25.756871509898474,-103.22293758031128 25.757124519596417,-103.22341902959494 25.757423739568424,-103.22349458021101 25.75751917009491,-103.22359950998492 25.757651690365464,-103.22408528039719 25.75828563003236,-103.22663764970787 25.76159843026757,-103.22653590525992 25.761855174479606,-103.22630975461713 25.762425844614683,-103.22492446025532 25.76592137957367,-103.22458270970009 25.76678368958764,-103.22380565019549 25.768744340073823,-103.22289886030136 25.77103219970897,-103.22231709026708 25.77249993973919,-103.22188707978174 25.773584819815298,-103.221433430219 25.774729280348836,-103.22114857958708 25.775447880325103,-103.2211046496406 25.775558720174445,-103.22085955029267 25.776177080164786,-103.22338596993923 25.776053910122812,-103.22788215015842 25.775834630149774,-103.22790073973466 25.77583371967532,-103.23014574045995 25.768041830430874,-103.2315165397602 25.763283550232387,-103.23178051950639 25.76299786021964,-103.23264264973251 25.762064770384796,-103.23366185977925 25.76096165987201,-103.23477625021913 25.759755490386567,-103.2363774799358 25.758022349549847,-103.23679079971424 25.75757497038002,-103.23686452000499 25.75749515006852,-103.23740932035072 25.756905479694566,-103.23778018023405 25.7565040302333,-103.23804848024386 25.756213619747044,-103.2384186897762 25.755812860186623,-103.24325473976039 25.757078630329886,-103.24309964956635 25.75558491981444,-103.24305714987314 25.755175570359015,-103.24257211041477 25.7505038199277,-103.24174260047751 25.75146617975699,-103.24093304994987 25.75238952009812,-103.24019077965838 25.752950020078217,-103.2388449402259 25.753664980075413,-103.23618561987077 25.75314962039512,-103.23685929029585 25.752334489627685,-103.23863129043156 25.750388580226698,-103.24793758003565 25.743589879931562,-103.2499998495728 25.74230965024863,-103.25047036953197 25.74119826013306,-103.25063911026689 25.736739249658953,-103.25149047955381 25.735763229968825,-103.25160677015171 25.735629919624756,-103.25620335037351 25.73345494999539,-103.25854372011968 25.73232474967223,-103.25925281974693 25.732262510038638,-103.2602368798989 25.731658580088748,-103.26551055008449 25.72864431978266,-103.2669301096957 25.727156220425343,-103.26701663012356 25.727065520060165,-103.26706942046128 25.72696362985154,-103.27040366039667 25.720525939976028,-103.27043343024869 25.71951716975383,-103.27155991958902 25.717110350251474,-103.27090122955276 25.71583453995943,-103.27149531048462 25.714878140128363,-103.27227265036096 25.713936370083545,-103.27257931972396 25.71308994958325,-103.27285952015609 25.712363050250573,-103.2730866900945 25.71153546021614,-103.27320496957269 25.71146285011882,-103.2732610796375 25.711428380216034,-103.27328183040485 25.711415629682875,-103.2733177700291 25.711393570036634,-103.27333317967589 25.711384110402022,-103.27388044957716 25.71104804970652,-103.27482372037615 25.710468819559523,-103.27645983012256 25.709464110342154,-103.2783000297088 25.70801775032578,-103.27847253981282 25.707882149798365,-103.28144506020854 25.70821087954684,-103.28152643038257 25.708121940119497,-103.28432994014298 25.707635769817244,-103.28435185038695 25.70763566008185,-103.28604686045055 25.70762692113172,-103.28766485007009 25.707618550188286,-103.28930899861814 25.707610051241062,-103.28975448041506 25.70753579990972,-103.29399207961718 25.70682950964354,-103.29449771001994 25.707102400310475,-103.29456510985469 25.707207919889967,-103.29507411001619 25.707672970375327,-103.29553570973171 25.708356090074417,-103.29476851042376 25.708897019979133,-103.29474947997215 25.70893065016986,-103.29473636954737 25.70895505040758,-103.29472373966158 25.70897964988083,-103.2947000801411 25.70902908969454,-103.29468882962735 25.709054369921148,-103.29467809039798 25.70907982010833,-103.29466783021047 25.709105419659068,-103.29464917033198 25.709156150043,-103.29464231977043 25.709176490147613,-103.29463209019974 25.709208579913522,-103.29462436963355 25.70923484982123,-103.29461038046948 25.709287920143865,-103.2945984898206 25.70934139959023,-103.29459332010049 25.709368259948988,-103.29458867999297 25.709395220280655,-103.29458128989171 25.709446720129705,-103.29453043048554 25.710108509726155,-103.29479747973038 25.710663690271076,-103.2947742300603 25.711325820360074,-103.29529057994058 25.711975659676412,-103.29514994966706 25.713123830006566,-103.29496706011456 25.713359150089516,-103.29487803010555 25.713809779878687,-103.29486482981521 25.713884680351242,-103.29485689028003 25.713936820323582,-103.2948499701574 25.713989079841497,-103.29484405013781 25.71404143003936,-103.29483912030176 25.71409388006829,-103.29483523020947 25.714146379638407,-103.2948323400251 25.714198949936417,-103.29483046035548 25.714251550060965,-103.29482960021208 25.71430417993834,-103.29482975038702 25.71435681969008,-103.29483091049283 25.714409430318653,-103.29483308972183 25.714462029888665,-103.29483629040058 25.714514550356697,-103.29484049038125 25.714567079882045,-103.29484570961299 25.71461951036936,-103.29485191984855 25.714671820281822,-103.29505796977065 25.715763659557695,-103.29525550978067 25.716158250296502,-103.29527954973105 25.716151779949385,-103.29537740036085 25.716174779717704,-103.29586540009058 25.716916800299444,-103.29594706028226 25.71757482967533,-103.29614002026999 25.71777594980088,-103.29639172011512 25.71805018008922,-103.29664494987595 25.71826882971851,-103.29691241975277 25.718474200016715,-103.29720363041116 25.71865926008644,-103.29743784988904 25.718808109790473,-103.29772396985108 25.718923520191055,-103.29817154014178 25.71910404967305,-103.29912365988295 25.71906242986242,-103.30294065033593 25.716683490357212,-103.30316751043769 25.716619290114423,-103.30315214043968 25.71673097029806,-103.30308618015515 25.71721078038125,-103.30304641989075 25.71750014043397,-103.30332128018371 25.72022841977069,-103.30626497019624 25.720995819747586,-103.31000388040233 25.72197045034889,-103.30710038014567 25.72621083016959,-103.30442918025514 25.730122779747532,-103.30260387990924 25.732285340151506,-103.30202945030697 25.73521604960088,-103.30189474985961 25.736051310391602,-103.30155802972486 25.737610940324473,-103.30129931967458 25.738809220420265,-103.30115345987369 25.7394847997667,-103.30114357976065 25.739528060229418,-103.30104753957266 25.73994870989003,-103.30097217963736 25.740278749556722,-103.30007021952045 25.743150109613794,-103.30259663047697 25.744400629704344,-103.30288357862077 25.744518635984065,-103.3029064005001 25.744528020390476,-103.3028953759693 25.744543030781585,-103.30287434152459 25.74457167005795,-103.30286666021543 25.744582128965263,-103.30244674180558 25.74515385348687,-103.30225353413601 25.74541690862982,-103.30167901026972 25.74619911924094,-103.30114226009144 25.74692989005922,-103.30085600312168 25.747447212814947,-103.29957142038286 25.74976865127536,-103.29951126026081 25.749877349820608,-103.29907177966837 25.750671519910554,-103.29844929045005 25.751796380390815,-103.2959310196195 25.75634678017228,-103.29879327977666 25.754671319712443,-103.29955534015417 25.7545165999192,-103.29961901983766 25.754474570139962,-103.3010014795807 25.753562109932915,-103.30347300049378 25.75278111035678,-103.30531187900671 25.75359906003652,-103.30775048875529 25.75161275149732,-103.30783128018862 25.751546971350862,-103.30791708028926 25.751163969843915,-103.30862138003764 25.75087808997192,-103.31029934995571 25.748174549610212,-103.31238137009673 25.744384279793536,-103.31269234961232 25.74395251011623,-103.31534081962535 25.741937140346366,-103.31732971952759 25.74035010999458,-103.32074437024235 25.73762522954732,-103.32171367975407 25.737394970122125,-103.32199760006125 25.737327519750636,-103.32273331048 25.737324890215206,-103.32565985998069 25.737314310124816,-103.32838769000914 25.737304419870867,-103.32645237012409 25.73559588017359,-103.33008746023695 25.73236491028962,-103.32932806030257 25.731087420309805,-103.33017407965805 25.730025089796243,-103.3328492603872 25.728311259679685,-103.33296165970847 25.72823926022606,-103.3330178498014 25.728203259640864,-103.3334519395752 25.7279251496676,-103.33786368963338 25.7250985500103,-103.33818924979575 25.72513471029528,-103.33824943049395 25.72514140039776,-103.33829318000343 25.725146250318332,-103.33831618000337 25.725148800450242,-103.33889522005508 25.725213089901303,-103.33924151032846 25.725403649745502,-103.33928846014612 25.7253319697149,-103.3402891804269 25.724034479682587,-103.34052790956929 25.72377027981662,-103.34089655016028 25.723470179963954,-103.34107341993281 25.723300939674886,-103.34161647995785 25.722964689925632,-103.34187962012638 25.72287551042409,-103.34483291991961 25.721855349571427,-103.34895617039922 25.720105570010148,-103.34932896816036 25.719938077022135,-103.34932905583925 25.71993803546026,-103.34932911461617 25.71993800684254,-103.34959004963666 25.71982076975398,-103.35014758007706 25.719529660449,-103.35052944796772 25.719325273247335,-103.35071722007078 25.71922477013885,-103.35139252016633 25.718692719992703,-103.35151221984673 25.71855794025626,-103.35170879965214 25.718356259943917,-103.35193197031926 25.718058120239235,-103.35203773475578 25.71789997785777,-103.35203826518294 25.717899186057167,-103.35210848970408 25.717794180426438,-103.35231667980328 25.71737675037558,-103.3526249696963 25.716887849717594,-103.35283606005476 25.716553090053992,-103.35271049026767 25.716489290200343,-103.35269823048047 25.716482969799273,-103.3476028304976 25.71299833972344,-103.34756029003434 25.712969249822194,-103.3475482002878 25.71296054034518,-103.34385267992444 25.71029968955399,-103.34260642982218 25.709402319562287,-103.34152437977366 25.708622880061043,-103.33939448048004 25.707903980156004,-103.33943689022934 25.70760481996126,-103.34014154958894 25.706542319569607,-103.34029276956835 25.70629871025541,-103.34029895026863 25.705852719582523,-103.3402256002541 25.705520400074988,-103.34118586032453 25.70502142023966,-103.3422327704048 25.704523400262943,-103.34623453997852 25.703431369577217,-103.35171578002357 25.701885250034323,-103.35245879986198 25.701422969870066,-103.35368271961066 25.700652309862647,-103.35499086046651 25.699860029603343,-103.35461699998285 25.699462579778015,-103.35216379982307 25.69666520018204,-103.35056248001986 25.694839369798885,-103.34921371018099 25.693443940415477,-103.35055042028151 25.692937139959582,-103.35078456996315 25.69286630968658,-103.35109972034095 25.692783850007658,-103.35124478005802 25.692748710331657,-103.35138982967757 25.69271356970016,-103.35153489013496 25.69267841977151,-103.35167993960707 25.692643279779162,-103.35182500001127 25.692608139558928,-103.35197005033689 25.69257300019717,-103.35211510958321 25.69253785971766,-103.35226014974238 25.692502720173636,-103.35240521985178 25.69246758023914,-103.35255027976933 25.692432430279993,-103.3526953196931 25.6923972903343,-103.35284037955759 25.692362150083554,-103.35303725957108 25.69230981965869,-103.35324190975844 25.692244150239304,-103.35337967955374 25.692190059921913,-103.35351745024468 25.692135970380676,-103.35365521981049 25.692081879818815,-103.35379298015864 25.692027780142467,-103.35393074950454 25.69197369024303,-103.35406851973678 25.691919600212884,-103.35420628985425 25.691865510060452,-103.35434405985703 25.691811419785836,-103.3544818295466 25.691757310343377,-103.35461960032094 25.691703219815665,-103.35475736988515 25.691649120105083,-103.35489514043955 25.69159503023984,-103.35503290987832 25.691540940261007,-103.35517068020332 25.691486850151307,-103.35530845020554 25.69143273996687,-103.35542507990148 25.691386950230324,-103.35535812047138 25.679117910132874,-103.35533718042552 25.67900404956076,-103.35659068014918 25.67881810956648,-103.36039236961443 25.67676686038125,-103.34846431014721 25.672141399776493,-103.346728250069 25.65900653956689,-103.34650875001022 25.65733943038545,-103.34650174980779 25.65728621966244,-103.34623742962425 25.655278509971694,-103.346238549591 25.654678949627666,-103.34624180026562 25.652926350019598,-103.34650815000151 25.65246155019895,-103.34753604983877 25.650667890241166,-103.34548837977191 25.645558980381324,-103.34690295021198 25.64161480039718,-103.36606343018158 25.626986089782704,-103.36575463010414 25.626480230190836,-103.36615456952154 25.626066830103156,-103.36485419070812 25.625919457956385,-103.36478281981103 25.625911369556718,-103.36361314988916 25.62577880018182,-103.36109673810834 25.625410194097213,-103.36107420966587 25.62540689393326,-103.36105110203103 25.625403508950285,-103.36059419337458 25.625336575298903,-103.36056182970017 25.625331834884122,-103.36052724343982 25.6253267679878,-103.358777102153 25.625070374186492,-103.35875258573965 25.625066782366872,-103.35872969768143 25.62506342962729,-103.35818999226004 25.62498435890295,-103.35814828154604 25.62497824785487,-103.35811690507087 25.62497365085079,-103.35729777765866 25.624853639093317,-103.35725868139534 25.624847910834802,-103.35716628672971 25.624834373789028,-103.35585995614943 25.62464297005414,-103.3558230805672 25.624637567090687,-103.35582189513451 25.624637393117368,-103.35541190998937 25.624577319678536,-103.35127960016831 25.62397176995283,-103.34208244955389 25.622623540422268,-103.33634648974277 25.62166852039782,-103.32644782992894 25.62026381989436,-103.32133322035688 25.61957312011168,-103.31837037982963 25.619172939585425,-103.31695784998902 25.618982139709118,-103.31294979989563 25.618331020095894,-103.31178202028616 25.618141279901707,-103.30943167822139 25.61778073209038,-103.3062216800073 25.61728825030964,-103.30407192026686 25.616960563608316,-103.30319234031188 25.61682648028645,-103.30269915068862 25.6167712361745,-103.30269904051092 25.616771223475894,-103.30179345006165 25.616669780440105,-103.30173849032832 25.61698851025514,-103.29634963006177 25.61620438007867,-103.29576218010226 25.61611890970829,-103.29569557020672 25.61610920008073,-103.29561989015721 25.616098179631024,-103.29372573951193 25.61639684964686,-103.28893340049531 25.61834529032258,-103.28820418045416 25.61547480033839,-103.2747432000962 25.61294468981798,-103.27473761967337 25.61293295021234,-103.27471055043135 25.612876140325213,-103.27469248995374 25.612838200055876,-103.27467384989555 25.61279900000642,-103.27245013994434 25.608127619969807,-103.27056962037774 25.60375045961966,-103.27038315007003 25.603316400359404,-103.2699219800806 25.602242939807468,-103.26990097038097 25.602194029586855,-103.26838342040365 25.599243080037112,-103.26157394431372 25.583995556444535,-103.26157393102174 25.583995526616818,-103.26116469262578 25.583079045079728,-103.26114239924168 25.58302912007943,-103.26090563229394 25.582498878900523,-103.26081442608984 25.582294620420782,-103.25956846041154 25.579504179743225,-103.27167808953917 25.581535250128994,-103.29061418022724 25.585074510056756,-103.29245557955743 25.57641343011238,-103.29509385998944 25.577207519820092,-103.29661090954428 25.577664110448325,-103.29789627984374 25.578050969833157,-103.29796827952289 25.578072629770105,-103.29801605979512 25.57808702041224,-103.29812688041355 25.578120369662358,-103.29956702021218 25.578553770182936,-103.30269819985219 25.5794960500985,-103.30308005008904 25.57801816973182,-103.30838313976187 25.55583248002668,-103.30952642020468 25.551375740126787,-103.30955224961032 25.55127506027513,-103.30958170986793 25.55116018039078,-103.30959351002 25.55111345997858,-103.30941768986307 25.551101420342505,-103.30947777986331 25.55086157019207,-103.31021526019035 25.54799296955369,-103.31060145049189 25.547184690051708,-103.31087269029574 25.546127199833577,-103.31155382963698 25.54347151013293,-103.3115913201601 25.543325349662425,-103.31187433962694 25.542221850449152,-103.31208159975071 25.541413740348887,-103.31212821962622 25.541231950256574,-103.31231894974793 25.54048828007147,-103.31235459971998 25.54034924977907,-103.31245050927258 25.539975341177467,-103.31277714922416 25.538701600367133,-103.31364273910955 25.535326311342914,-103.31374836987663 25.53491440118853,-103.31379667875241 25.534725970043652,-103.31429477028617 25.53278140026505,-103.31446060032617 25.532165289553603,-103.3144668502602 25.532112550131544,-103.31449602984017 25.531982520108443,-103.31461869019996 25.531520369953057,-103.31465069009916 25.531395600373415,-103.31574963002322 25.527109659900532,-103.31587649014126 25.52661485999039,-103.31630806037265 25.524931619872206,-103.31739105956639 25.520707369786237,-103.32026608971654 25.510062220345787,-103.32111466003651 25.50660466036895,-103.32352791017324 25.497472800407834,-103.32324106020003 25.497415079784687,-103.32679891985805 25.483007549695103,-103.32905630969971 25.473864280017565,-103.33084964534835 25.46659938458896,-103.33084965302685 25.466599353680607,-103.330877492096 25.46648658063677,-103.33091921899351 25.466317554210846,-103.33092664994997 25.466287458953417,-103.33094877953415 25.46619782045329,-103.33230568047418 25.460700279933846,-103.33223783047741 25.460687570265222,-103.33321543024086 25.457463289627285,-103.33374946008189 25.455701970314692,-103.3358376600527 25.448876019655216,-103.3367512297766 25.444516570165717,-103.33684790982596 25.444444309607917,-103.33707453984101 25.44340477984109,-103.33701123037943 25.443321419573408,-103.3371077799798 25.443237820116167,-103.33730048963074 25.442300629743286,-103.33733700028915 25.44220848017447,-103.33753022992482 25.441322319808165,-103.33756174038407 25.44122908029692,-103.33776058043831 25.44030931022526,-103.33758712041544 25.439790060187136,-103.33878739981974 25.435342679629002,-103.34098993978645 25.427180650404793,-103.34113103005855 25.426657740321403,-103.34203539966724 25.422770199664114,-103.34218978034511 25.422106549554513,-103.34348152032968 25.41635710965815,-103.34353911020155 25.416100780300823,-103.34205988964901 25.4159366596363,-103.34136771980911 25.410142229910164,-103.33774518004549 25.39757297004698,-103.33763247990497 25.397181849872,-103.33762973969944 25.39695555009952,-103.33761985048325 25.396136319889933,-103.33756834045965 25.39187145002478,-103.33754492018332 25.38993268029725,-103.33751983027798 25.387853490280676,-103.33747485033255 25.384128519584834,-103.33725382032618 25.381244629971093,-103.33701725097525 25.374228558973755,-103.33701646012533 25.374205110250315,-103.336978910889 25.373091425042404,-103.33697094540992 25.372855165366303,-103.33694687255787 25.37214114654688,-103.33694176669079 25.37198970640658,-103.33693268742375 25.371720405681614,-103.33693102529618 25.37167111375271,-103.33692571191425 25.371513459903312,-103.3369199995735 25.371343880276854,-103.33659141817517 25.37129911859013,-103.33642185970393 25.371276020016722,-103.33567437376564 25.371705997354695,-103.33562195091054 25.371736152614062,-103.33560357952577 25.371746720303207,-103.33534164998731 25.37190474620003,-103.33530302703292 25.371928048448012,-103.33526620435443 25.37195026402253,-103.33454314624481 25.37238649037978,-103.33415421467888 25.372621132634322,-103.33233113954084 25.37372097044741,-103.33119709007565 25.374458430387463,-103.32834997016599 25.371073720105755,-103.32419607963052 25.372356179687472,-103.32204584978616 25.37465601989716,-103.32050464977371 25.375798140005315,-103.31973232021187 25.376204619926384,-103.31899032049573 25.37703415018619,-103.31840633993498 25.37812096964619,-103.31756351971607 25.37921000007556,-103.31694442007785 25.381896220365917,-103.31687464982043 25.382649370199985,-103.31581874975194 25.383175909959675,-103.31145885996858 25.382131600403213,-103.30965928018163 25.385228200121517,-103.30722388020614 25.38699612026815,-103.30714250960763 25.38699682030736,-103.30711176982125 25.388308750101558,-103.30707979951156 25.389672690408048,-103.3030295999871 25.39201397040388,-103.30295991977798 25.39205424963474,-103.29862791991368 25.39455816990946,-103.29855111003575 25.394602570047127,-103.28707617034203 25.40157748982871,-103.2659310901014 25.414782679712886,-103.26261317001578 25.41461568030293,-103.24979646026856 25.414349599947897,-103.24965349008895 25.414346629981907,-103.24943502982876 25.414342079924737,-103.24715415026309 25.41429459973402,-103.23223365990498 25.413983170161515,-103.23213557971341 25.413981109563125,-103.23171167983395 25.413972230178516,-103.2315043397673 25.41396788973462,-103.23145127987635 25.41396678034009,-103.23103865990467 25.413958139589596,-103.23091943006176 25.41395564980526,-103.22992153987539 25.413942680310356,-103.22978183003177 25.413940859927365,-103.22884291014851 25.41392864998275,-103.20612611024914 25.413743820324243,-103.20604298020665 25.413740029953146,-103.2023074295026 25.413570400034175,-103.20183549041869 25.41357466025127,-103.19326957960786 25.41316102040487,-103.18870734969096 25.412814770032824,-103.18704348019837 25.41268846036857,-103.17506733980514 25.41205497991983,-103.1644202903359 25.41149104973563,-103.16446982000515 25.411205860386445,-103.1644760303038 25.411170030359983,-103.16449561956462 25.41105722975506,-103.16474054033327 25.409646599830182,-103.1647853099832 25.40938876980138,-103.16490773951686 25.40868351998874,-103.16444459961909 25.408664850334716,-103.16258797990216 25.408589920412652,-103.16098491015389 25.40852523024533,-103.16014959954096 25.408491510144728,-103.16068563005568 25.406843649975826,-103.15932912026577 25.406780680388493,-103.15628351986363 25.406639260288017,-103.14532154955735 25.406157090228376,-103.14535612011655 25.406839000273024,-103.1447062497471 25.40644413966045,-103.13825696952034 25.402470660189394,-103.1381031696314 25.396610050349892,-103.138082339795 25.395816229746544,-103.13805242964914 25.3946765797552,-103.1380232797968 25.393565480307018,-103.13801994017801 25.39343825010971,-103.12428089049564 25.39116635021297,-103.12363822033507 25.394005720103053,-103.10965858029768 25.390589350104804,-103.10540756996241 25.40889725006589,-103.10483538022827 25.412372820102107,-103.10386597033452 25.418736569848676,-103.10368226031954 25.419942450126698,-103.10358563007344 25.42053848955348,-103.10355916959988 25.420701709933212,-103.10353017962693 25.42088047985851,-103.1034355804192 25.421463970042396,-103.10340614980848 25.421645479896853,-103.10338891952966 25.421742120045934,-103.10263540030618 25.425965969898286,-103.10181040027777 25.43059004964539,-103.10028388952844 25.43950931035677,-103.10020123030048 25.439984820344847,-103.10016457003489 25.440195709974972,-103.1001620000202 25.440210450356716,-103.1001236601832 25.440430449659303,-103.1000852896883 25.44065061967875,-103.09852645982185 25.449593970099443,-103.09729676971686 25.456866819909237,-103.09720928997878 25.45738426018295,-103.09571062040133 25.466292349737046,-103.09414205994099 25.475694600051938,-103.08417357993666 25.474286909579305,-103.08409586006287 25.474738819767182,-103.08369601993692 25.47706370959841,-103.08316703044221 25.480139180321643,-103.08259963020954 25.483437919950177,-103.08241559991184 25.484507780041497,-103.08180008986385 25.488085879733262,-103.08108785029718 25.492225889951783,-103.08122234967621 25.501520060305282,-103.08972989044017 25.50248554044552,-103.08660054009636 25.52084822972985,-103.08196343001758 25.54764642032157,-103.08622390971497 25.548174059990018,-103.08640938011438 25.55305280000222,-103.0870718497471 25.570477570028203,-103.08634164966345 25.571135939755422,-103.08466425995266 25.575233690444193,-103.08944129027732 25.583507079663164,-103.09394705994455 25.59640479957254,-103.09511653960463 25.599751999846788,-103.08058441956784 25.602696079716182,-103.0745000501655 25.597086310042272,-103.06814665971812 25.60277654000558,-103.03209057005354 25.634851819980256,-103.030785649873 25.641116919869077,-103.0304703702654 25.642584949671303,-103.0352204504797 25.64367061961407,-103.04027765022823 25.64467298016409,-103.06344537984356 25.64930554040933,-103.07422905955691 25.619391289808803,-103.08780846019668 25.629467490298723,-103.0999780800732 25.638495180154308,-103.10549162003552 25.642584480375163,-103.11181357022151 25.65272651018681,-103.11202642994853 25.657296450199695,-103.12157314971552 25.654469350376274,-103.13620110951696 25.670307030234568,-103.13807676990781 25.662584350009467,-103.14344073991441 25.669374369636103,-103.14914277963149 25.669798860147182,-103.15237559952611 25.671830120197868,-103.15560851954953 25.673861320041198,-103.16561626017928 25.675754019564238,-103.17428384954934 25.676908549719627,-103.19896162977693 25.680049290139877,-103.20098588962891 25.70515272028453,-103.20175187951888 25.713881050224472,-103.20222769047237 25.720419179992717,-103.20238979983901 25.722441720006657,-103.20438930992485 25.747387770275267,-103.20506857963105 25.75586115013624,-103.20527221985844 25.75793096999999,-103.20800791983072 25.75818730984004,-103.20920568979334 25.757772030398684,-103.21511285951328 25.75435677016185,-103.21510882995797 25.75356382975653,-103.21728608038623 25.753636369582082,-103.21811897038204 25.754150740037204,-103.21819588043503 25.754198249970543,-103.21938945974358 25.75493534959979,-103.21947530994349 25.75498836966584,-103.22099335020293 25.7559276197035,-103.22252457031466 25.756871509898474))');*/
var feature = format.readFeature(data);
feature.getGeometry().transform('EPSG:4326', 'EPSG:3857');
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
features: [feature]
})
});
var center = feature.getGeometry();
var map = new ol.Map({
layers: [raster, vector],
target: 'map',
view: new ol.View({
center: [center.getInteriorPoint().getFirstCoordinate()[0], center.getInteriorPoint().getFirstCoordinate()[1]],
zoom: 9
})
});
} }
</script> </script>
{% endblock %} {% endblock %}
...@@ -174,6 +174,11 @@ def Reports(request): ...@@ -174,6 +174,11 @@ def Reports(request):
#"../ static / reports / tmpImages / repsat_test_dev / umorales @ centrogeo.edu.mx / "+str(producto['id']) / myzip.zip" #"../ static / reports / tmpImages / repsat_test_dev / umorales @ centrogeo.edu.mx / "+str(producto['id']) / myzip.zip"
wkt = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/findProducts.json"
with open(wkt, 'r') as jsonfile:
polygon = json.load(jsonfile)
print(polygon['wkt'])
for file in os.listdir(path=zip_path): for file in os.listdir(path=zip_path):
if file.endswith(".zip"): if file.endswith(".zip"):
print(file) print(file)
...@@ -192,6 +197,7 @@ def Reports(request): ...@@ -192,6 +197,7 @@ def Reports(request):
"log_info": log, "log_info": log,
"initial_folder" :initial_folder, "initial_folder" :initial_folder,
"zip" : zip, "zip" : zip,
"polygon": polygon['wkt'],
}) })
size = 0 size = 0
final_size = 0 final_size = 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment