This commit is contained in:
Bob 2019-12-11 10:09:14 +08:00
parent c28153cb3d
commit 025d2ec90b
5 changed files with 253 additions and 115 deletions

View File

@ -4,6 +4,9 @@
<list default="true" id="9cbc7ee8-e518-44ca-870c-9743cf0f1b98" name="Default Changelist" comment=""> <list default="true" id="9cbc7ee8-e518-44ca-870c-9743cf0f1b98" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dashboard/static/dashboard/js/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/dashboard/static/dashboard/js/index.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/dashboard/static/dashboard/js/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/dashboard/static/dashboard/js/index.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dashboard/templates/dashboard/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/dashboard/templates/dashboard/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dashboard/urls.py" beforeDir="false" afterPath="$PROJECT_DIR$/dashboard/urls.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/dashboard/views.py" beforeDir="false" afterPath="$PROJECT_DIR$/dashboard/views.py" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -71,22 +74,11 @@
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dashboard/static/dashboard/js/vector.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3630">
<caret line="165" column="27" selection-start-line="165" selection-start-column="27" selection-end-line="165" selection-end-column="27" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/dashboard/static/dashboard/js/index.js"> <entry file="file://$PROJECT_DIR$/dashboard/static/dashboard/js/index.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="185"> <state relative-caret-position="348">
<caret line="304" column="39" selection-start-line="304" selection-start-column="39" selection-end-line="304" selection-end-column="39" /> <caret line="384" column="53" selection-start-line="384" selection-start-column="53" selection-end-line="384" selection-end-column="53" />
<folding> <folding>
<element signature="n#style#0;n#a#0;n#div#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#a#1;n#div#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#0;n#!!top" expanded="true" /> <element signature="n#style#0;n#div#0;n#!!top" expanded="true" />
</folding> </folding>
</state> </state>
@ -97,7 +89,7 @@
<entry file="file://$PROJECT_DIR$/import_points.py"> <entry file="file://$PROJECT_DIR$/import_points.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="110"> <state relative-caret-position="110">
<caret line="11" lean-forward="true" selection-start-line="11" selection-end-line="11" /> <caret line="11" selection-start-line="11" selection-end-line="11" />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -105,8 +97,38 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dashboard/templates/dashboard/index.html"> <entry file="file://$PROJECT_DIR$/dashboard/templates/dashboard/index.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4708"> <state relative-caret-position="-989">
<caret line="214" column="77" selection-start-line="214" selection-start-column="77" selection-end-line="214" selection-end-column="77" /> <caret line="248" column="86" selection-start-line="248" selection-start-column="86" selection-end-line="248" selection-end-column="86" />
<folding>
<element signature="e#11579#11599#0#HTML" expanded="true" />
<element signature="e#11742#11777#0#HTML" expanded="true" />
<element signature="e#11890#11911#0#HTML" expanded="true" />
<element signature="e#14256#14292#0#HTML" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="154">
<caret line="7" column="88" selection-start-line="7" selection-start-column="88" selection-end-line="7" selection-end-column="88" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/dashboard/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="411">
<caret line="33" lean-forward="true" selection-start-line="33" selection-end-line="33" />
<folding>
<element signature="e#0#30#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
@ -141,6 +163,8 @@
<find>favicon</find> <find>favicon</find>
<find>new WebSocket</find> <find>new WebSocket</find>
<find>-1</find> <find>-1</find>
<find>historical_route_submit</find>
<find>connect_websocket();</find>
</findStrings> </findStrings>
<dirStrings> <dirStrings>
<dir>D:\python\p3\linbei</dir> <dir>D:\python\p3\linbei</dir>
@ -180,12 +204,12 @@
<option value="$PROJECT_DIR$/dashboard/static/dashboard/css/popup.css" /> <option value="$PROJECT_DIR$/dashboard/static/dashboard/css/popup.css" />
<option value="$PROJECT_DIR$/dashboard/static/dashboard/js/popup.js" /> <option value="$PROJECT_DIR$/dashboard/static/dashboard/js/popup.js" />
<option value="$PROJECT_DIR$/dashboard/templates/dashboard/results_by_keywords.html" /> <option value="$PROJECT_DIR$/dashboard/templates/dashboard/results_by_keywords.html" />
<option value="$PROJECT_DIR$/dashboard/urls.py" />
<option value="$PROJECT_DIR$/dashboard/views.py" />
<option value="$PROJECT_DIR$/dashboard/templates/dashboard/vector.html" /> <option value="$PROJECT_DIR$/dashboard/templates/dashboard/vector.html" />
<option value="$PROJECT_DIR$/dashboard/templates/dashboard/index.html" />
<option value="$PROJECT_DIR$/dashboard/static/dashboard/js/vector.js" /> <option value="$PROJECT_DIR$/dashboard/static/dashboard/js/vector.js" />
<option value="$PROJECT_DIR$/dashboard/static/dashboard/js/index.js" /> <option value="$PROJECT_DIR$/dashboard/static/dashboard/js/index.js" />
<option value="$PROJECT_DIR$/dashboard/templates/dashboard/index.html" />
<option value="$PROJECT_DIR$/dashboard/urls.py" />
<option value="$PROJECT_DIR$/dashboard/views.py" />
</list> </list>
</option> </option>
</component> </component>
@ -207,7 +231,6 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
@ -215,10 +238,16 @@
<item name="linbei" type="b2602c69:ProjectViewProjectNode" /> <item name="linbei" type="b2602c69:ProjectViewProjectNode" />
<item name="linbei" type="462c0819:PsiDirectoryNode" /> <item name="linbei" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="linbei" type="b2602c69:ProjectViewProjectNode" />
<item name="linbei" type="462c0819:PsiDirectoryNode" />
<item name="dashboard" type="462c0819:PsiDirectoryNode" />
</path>
</expand> </expand>
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
@ -228,7 +257,7 @@
<property name="WebServerToolWindowFactoryState" value="false" /> <property name="WebServerToolWindowFactoryState" value="false" />
<property name="database.console.LAST_STATE" value="false" /> <property name="database.console.LAST_STATE" value="false" />
<property name="editor.config.ad.shown" value="true" /> <property name="editor.config.ad.shown" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../linbeitest" /> <property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" /> <property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" /> <property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="nodejs_package_manager_path" value="npm" /> <property name="nodejs_package_manager_path" value="npm" />
@ -368,7 +397,8 @@
<workItem from="1575616042709" duration="903000" /> <workItem from="1575616042709" duration="903000" />
<workItem from="1575622080443" duration="636000" /> <workItem from="1575622080443" duration="636000" />
<workItem from="1575851747431" duration="2002000" /> <workItem from="1575851747431" duration="2002000" />
<workItem from="1575862650399" duration="1899000" /> <workItem from="1575862650399" duration="3867000" />
<workItem from="1576027710663" duration="2218000" />
</task> </task>
<task id="LOCAL-00001" summary="#creat"> <task id="LOCAL-00001" summary="#creat">
<created>1567674653918</created> <created>1567674653918</created>
@ -622,17 +652,24 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1575853736986</updated> <updated>1575853736986</updated>
</task> </task>
<option name="localTasksCounter" value="37" /> <task id="LOCAL-00037" summary="#index">
<created>1575875458769</created>
<option name="number" value="00037" />
<option name="presentableId" value="LOCAL-00037" />
<option name="project" value="LOCAL" />
<updated>1575875458769</updated>
</task>
<option name="localTasksCounter" value="38" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="255190000" /> <option name="totallyTimeSpent" value="259376000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" /> <frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2630458" /> <window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2657082" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" /> <window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" /> <window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" /> <window_info anchor="bottom" id="Message" order="0" />
@ -880,26 +917,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/dashboard/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="66">
<caret line="10" column="4" selection-start-line="10" selection-start-column="4" selection-end-line="10" selection-end-column="4" />
<folding>
<element signature="e#0#30#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="66">
<caret line="4" column="10" selection-start-line="4" selection-start-column="10" selection-end-line="4" selection-end-column="10" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dashboard/templates/dashboard/results_by_keywords.html"> <entry file="file://$PROJECT_DIR$/dashboard/templates/dashboard/results_by_keywords.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="484"> <state relative-caret-position="484">
@ -943,38 +960,62 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/dashboard/static/dashboard/js/vector.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3630">
<caret line="165" column="27" selection-start-line="165" selection-start-column="27" selection-end-line="165" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dashboard/templates/dashboard/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4708">
<caret line="214" column="77" selection-start-line="214" selection-start-column="77" selection-end-line="214" selection-end-column="77" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/import_points.py"> <entry file="file://$PROJECT_DIR$/import_points.py">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="110"> <state relative-caret-position="110">
<caret line="11" lean-forward="true" selection-start-line="11" selection-end-line="11" /> <caret line="11" selection-start-line="11" selection-end-line="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dashboard/static/dashboard/js/vector.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="242">
<caret line="113" column="21" selection-start-line="113" selection-start-column="17" selection-end-line="113" selection-end-column="21" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/dashboard/static/dashboard/js/index.js"> <entry file="file://$PROJECT_DIR$/dashboard/static/dashboard/js/index.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="185"> <state relative-caret-position="348">
<caret line="304" column="39" selection-start-line="304" selection-start-column="39" selection-end-line="304" selection-end-column="39" /> <caret line="384" column="53" selection-start-line="384" selection-start-column="53" selection-end-line="384" selection-end-column="53" />
<folding> <folding>
<element signature="n#style#0;n#a#0;n#div#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#a#1;n#div#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#0;n#!!top" expanded="true" /> <element signature="n#style#0;n#div#0;n#!!top" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/dashboard/templates/dashboard/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-989">
<caret line="248" column="86" selection-start-line="248" selection-start-column="86" selection-end-line="248" selection-end-column="86" />
<folding>
<element signature="e#11579#11599#0#HTML" expanded="true" />
<element signature="e#11742#11777#0#HTML" expanded="true" />
<element signature="e#11890#11911#0#HTML" expanded="true" />
<element signature="e#14256#14292#0#HTML" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="154">
<caret line="7" column="88" selection-start-line="7" selection-start-column="88" selection-end-line="7" selection-end-column="88" />
<folding>
<element signature="e#0#19#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/dashboard/views.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="411">
<caret line="33" lean-forward="true" selection-start-line="33" selection-end-line="33" />
<folding>
<element signature="e#0#30#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component> </component>
</project> </project>

View File

@ -4,15 +4,7 @@ $(function () {
var map = new ol.Map({ var map = new ol.Map({
loadTilesWhileAnimating: true, loadTilesWhileAnimating: true,
target: 'map', target: 'map',
layers: [ layers: [],
new ol.layer.Tile({
title: "天地图路网",
source: new ol.source.XYZ({
url: 'http://t0.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=661147eab2db2ca4e3596de18a46929f'//Roadmap SATELLITE satellite
}),
}),
],
view: new ol.View({ view: new ol.View({
projection: projection, projection: projection,
center: ol.proj.transform([107.55375, 34.91028], 'EPSG:4326', 'EPSG:3857'), center: ol.proj.transform([107.55375, 34.91028], 'EPSG:4326', 'EPSG:3857'),
@ -23,6 +15,18 @@ $(function () {
}); });
var tianditu = new ol.layer.Tile({
title: "天地图路网",
source: new ol.source.XYZ({
url: 'http://t0.tianditu.com/DataServer?T=img_w&X={x}&Y={y}&L={z}&tk=661147eab2db2ca4e3596de18a46929f'//Roadmap SATELLITE satellite
}),
});
map.addLayer(tianditu);
var OSM = new ol.layer.Tile({
source: new ol.source.OSM()
});
//-------------------------------------------------------- //--------------------------------------------------------
//===================================页面加载完毕默认打开websocket====================================== //===================================页面加载完毕默认打开websocket======================================
@ -73,6 +77,83 @@ $(function () {
// }); // });
var road = new ol.layer.Vector({
source: new ol.source.Vector({
projection: 'EPSG:4326',
url: '/static/dashboard/json/road.json',
format: new ol.format.GeoJSON()
}),
maxZoom: 20,
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'rgb(137,132,132,255)'
}),
fill: new ol.style.Fill({
color: 'rgb(137,132,132,255)'
})
})
});
// map.addLayer(road);
var grass = new ol.layer.Vector({
source: new ol.source.Vector({
projection: 'EPSG:4326',
url: '/static/dashboard/json/grass.json',
format: new ol.format.GeoJSON()
}),
maxZoom: 20,
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'rgb(51,160,44,255)'
}),
fill: new ol.style.Fill({
color: 'rgb(51,160,44,255)'
})
})
});
// map.addLayer(grass);
var build = new ol.layer.Vector({
source: new ol.source.Vector({
projection: 'EPSG:4326',
url: '/static/dashboard/json/build.json',
format: new ol.format.GeoJSON()
}),
maxZoom: 20,
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'rgb(173,164,164,255)'
}),
fill: new ol.style.Fill({
color: 'rgb(173,164,164,255)'
})
})
});
// map.addLayer(build);
var pipe = new ol.layer.Vector({
source: new ol.source.Vector({
projection: 'EPSG:4326',
url: '/static/dashboard/json/pipe.json',
format: new ol.format.GeoJSON()
}),
maxZoom: 20,
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: 'rgb(250,249,246,255)'
}),
fill: new ol.style.Fill({
color: 'rgb(250,249,246,255)'
})
})
});
// map.addLayer(pipe);
var GeoJsonLayer = new ol.layer.Vector({ var GeoJsonLayer = new ol.layer.Vector({
source: new ol.source.Vector({ source: new ol.source.Vector({
projection: projection, projection: projection,
@ -134,7 +215,7 @@ $(function () {
var socket; var socket;
var viewport = map.getViewport(); var viewport = map.getViewport();
$(viewport).append('<div class="share" ><button id="coordinate_measurement_btn">坐标测量</button><button id="realtime_positioning_btn">实时定位</button><button id="historical_route_btn">历史轨迹</button><button id="zone_setting_btn">区域设置</button><a href="vector/mode/" style="color: black"><button>矢量</button></a><a href="/" style="color: black"><button>影像</button></a><button id="c">厂区</button><button id="m">煤场</button></div>'); $(viewport).append('<div class="share" ><button id="coordinate_measurement_btn">坐标测量</button><button id="realtime_positioning_btn">实时定位</button><button id="historical_route_btn">历史轨迹</button><button id="zone_setting_btn">区域设置</button><button id="vector">矢量</button><button id="image">影像</button><button id="c">厂区</button><button id="m">煤场</button></div>');
// $(viewport).append('<div class="scoket"><button id="connect_websocket">连接WebSocket</button><button id="close_websocket">关闭WebSocket</button></div>'); // $(viewport).append('<div class="scoket"><button id="connect_websocket">连接WebSocket</button><button id="close_websocket">关闭WebSocket</button></div>');
@ -148,6 +229,36 @@ $(function () {
map.removeInteraction(draw); map.removeInteraction(draw);
var view = map.getView(); var view = map.getView();
view.setCenter(ol.proj.transform([107.55375, 34.91028], 'EPSG:4326', 'EPSG:3857')); view.setCenter(ol.proj.transform([107.55375, 34.91028], 'EPSG:4326', 'EPSG:3857'));
});
$("#vector").click(function () {
map.removeInteraction(draw);
map.removeLayer(tianditu);
map.removeLayer(w35Layer);
map.removeLayer(w3132Layer);
map.removeLayer(GeoJsonLayer);
map.addLayer(OSM);
map.addLayer(road);
map.addLayer(grass);
map.addLayer(build);
map.addLayer(pipe);
map.addLayer(GeoJsonLayer);
});
$("#image").click(function () {
map.removeInteraction(draw);
map.removeLayer(OSM);
map.removeLayer(road);
map.removeLayer(grass);
map.removeLayer(build);
map.removeLayer(pipe);
map.removeLayer(GeoJsonLayer);
map.addLayer(tianditu);
map.addLayer(w35Layer);
map.addLayer(w3132Layer);
map.addLayer(GeoJsonLayer);
}); });
var box_closer = document.getElementById('box-closer'); var box_closer = document.getElementById('box-closer');
box_closer.onclick = function () { box_closer.onclick = function () {
@ -180,6 +291,7 @@ $(function () {
}); });
$("#people_btn").click(function () { $("#people_btn").click(function () {
connect_websocket();
map.removeInteraction(draw); map.removeInteraction(draw);
$("#box").show(); $("#box").show();
$("#realtime_positioning").show(); $("#realtime_positioning").show();
@ -212,8 +324,8 @@ $(function () {
for (var i = 0; i < array.length; i++) { for (var i = 0; i < array.length; i++) {
// console.log(array[i].ID) // console.log(array[i].ID)
var x = array[i].y; var x = array[i].x;
var y = array[i].x * -1.0; var y = array[i].y;
lon = (x * Math.cos(38 * Math.PI / 180) + y * Math.sin(38 * Math.PI / 180)) / 91026.63 + 107.553186752; lon = (x * Math.cos(38 * Math.PI / 180) + y * Math.sin(38 * Math.PI / 180)) / 91026.63 + 107.553186752;
lat = (y * Math.cos(38 * Math.PI / 180) - x * Math.sin(38 * Math.PI / 180)) / 111000 + 34.9092271939; lat = (y * Math.cos(38 * Math.PI / 180) - x * Math.sin(38 * Math.PI / 180)) / 111000 + 34.9092271939;
// console.log(lon, lat); // console.log(lon, lat);
@ -271,10 +383,7 @@ $(function () {
}); });
$("#historical_route_submit").click(function () { $("#historical_route_submit").click(function () {
// socket = new WebSocket("ws://210.77.68.214:50332"); connect_websocket();
// socket.onopen = function () {
// console.log('WebSocket open');//成功连接上Websocket
// };
map.removeInteraction(draw); map.removeInteraction(draw);
var peoinfo = $("#peoinfo").val(); var peoinfo = $("#peoinfo").val();
var peopleid = $("#peopleid").val(); var peopleid = $("#peopleid").val();
@ -302,7 +411,7 @@ $(function () {
for (var i = 0; i < array.length; i++) { for (var i = 0; i < array.length; i++) {
// console.log(array[i]) // console.log(array[i])
var y = array[i].y; var y = array[i].y;
var x = array[i].x ; var x = array[i].x;
var lon = (x * Math.cos(38 * Math.PI / 180) + y * Math.sin(38 * Math.PI / 180)) / 91026.63 + 107.553186752; var lon = (x * Math.cos(38 * Math.PI / 180) + y * Math.sin(38 * Math.PI / 180)) / 91026.63 + 107.553186752;
var lat = (y * Math.cos(38 * Math.PI / 180) - x * Math.sin(38 * Math.PI / 180)) / 111000 + 34.9092271939; var lat = (y * Math.cos(38 * Math.PI / 180) - x * Math.sin(38 * Math.PI / 180)) / 111000 + 34.9092271939;
@ -371,28 +480,21 @@ $(function () {
//-------------------------------------------------webscoket------------------------------------------------------- //-------------------------------------------------webscoket-------------------------------------------------------
$('.connect_websocket').click(function () { function connect_websocket() {
console.log("6666"); console.log("6666");
var str; var str = "ws://111.21.80.34:9004";
var ws = $(".wsurl").val();
console.log(ws.length);
if (ws.length != 0) {
str = ws
} else {
str = "ws://111.21.80.34:9004"
}
// if (window.s) { // if (window.s) {
// window.s.close() // window.s.close()
// } // }
/*创建socket连接*/ /*创建socket连接*/
socket = new WebSocket(str); socket = new WebSocket(str);
socket.onopen = function () { socket.onopen = function () {
console.log('WebSocket open');//成功连接上Websocket console.log('WebSocket open');//成功连接上Websocket
}; };
}); }
$('#close_websocket').click(function () { $('#close_websocket').click(function () {

View File

@ -124,10 +124,10 @@
{# <option value="人员查询">人员查询</option>#} {# <option value="人员查询">人员查询</option>#}
{# <option value="位置查询">位置查询</option>#} {# <option value="位置查询">位置查询</option>#}
{# </select>#} {# </select>#}
ws<input type="text" name="ws" class="wsurl" id="ws"><br> {# ws<input type="text" name="ws" class="wsurl" id="ws"><br>#}
<button class="btn btn-primary btn-sm connect_websocket" type="button" id="">连接websocekt {# <button class="btn btn-primary btn-sm connect_websocket" type="button" id="">连接服务器#}
</button> {# </button>#}
<button class="btn btn-primary btn-sm" type="button" id="people_btn">人员查询</button> <button class="btn btn-primary btn-sm" type="button" id="people_btn">连接服务器</button>
<button class="btn btn-primary btn-sm" type="button" id="site_btn">位置查询</button> <button class="btn btn-primary btn-sm" type="button" id="site_btn">位置查询</button>
</div> </div>
@ -207,13 +207,13 @@
<div id="history_query"> <div id="history_query">
<input type="text" style="width:230px;" id="peoinfo" <input type="text" style="width:230px;" id="peoinfo"
placeholder="人员编号例如0001"/><br> placeholder="人员编号例如0001"/><br>
<input type="text" style="width:230px;" id="peopleid" <input type="text" style="width:230px;margin-top: 5px" id="peopleid"
placeholder="id:例如8001"/><br> placeholder="id:例如8001"/><br>
<input type="text" style="width:230px; " id="time" <input type="text" style="width:230px;margin-top: 5px " id="time"
placeholder="时间(分钟)例如3"/><br> placeholder="时间(分钟)例如3"/><br>
<button type="button" class="btn btn-primary btn-sm connect_websocket" {# <button type="button" class="btn btn-primary btn-sm connect_websocket"#}
style="margin-top: 20px;">连接websocket {# style="margin-top: 20px;">连接websocket#}
</button> {# </button>#}
<button type="button" class="btn btn-primary btn-sm" <button type="button" class="btn btn-primary btn-sm"
style="margin-top: 20px;" id="historical_route_submit">查询 style="margin-top: 20px;" id="historical_route_submit">查询
</button> </button>
@ -246,7 +246,7 @@
<div id="" style="margin-top: 10px"> <div id="" style="margin-top: 10px">
<input type="text" style="width:230px;" id="peoinfo" <input type="text" style="width:230px;" id="peoinfo"
placeholder="对象名称"/><br> placeholder="对象名称"/><br>
<input type="text" style="width:230px; " id="time" <input type="text" style="width:230px; margin-top: 5px" id="time"
placeholder="时间范围"/><br> placeholder="时间范围"/><br>
<button type="button" class="btn btn-primary btn-sm" <button type="button" class="btn btn-primary btn-sm"
style="margin-top: 20px;margin-left: 200px" id="btn">查询 style="margin-top: 20px;margin-left: 200px" id="btn">查询

View File

@ -6,7 +6,4 @@ urlpatterns = [
path('2/', views.index_2, name='index_2'), path('2/', views.index_2, name='index_2'),
path('points/search/by/keywords/', views.points_search_by_keywords, name='points-search-by-keywords'), path('points/search/by/keywords/', views.points_search_by_keywords, name='points-search-by-keywords'),
path('points/search/by/sn/', views.points_search_by_sn, name='points-search-by-sn'), path('points/search/by/sn/', views.points_search_by_sn, name='points-search-by-sn'),
path('vector/mode/', views.vector_mode, name='vector-mode'),
] ]

View File

@ -30,8 +30,6 @@ def points_search_by_sn(request):
points = Points.objects.get(sn=sn) points = Points.objects.get(sn=sn)
return render(request,'dashboard/index.html',{'points':points}) return render(request,'dashboard/index.html',{'points':points})
def vector_mode(request):
return render(request,'dashboard/vector.html')