Commit 4b8cd313 authored by jkerr's avatar jkerr
Browse files

worked on map

parent 2837097d
...@@ -2,13 +2,9 @@ ...@@ -2,13 +2,9 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="cccfd40b-d5c2-4431-bcfd-f34d25764049" name="Default Changelist" comment=""> <list default="true" id="cccfd40b-d5c2-4431-bcfd-f34d25764049" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/scripts/filterSites.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/scripts/setbooking.js" afterDir="false" />
<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$/index.html" beforeDir="false" afterPath="$PROJECT_DIR$/index.html" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/map.js" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/map.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/scripts/map.js" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/map.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/switchbooking.js" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/switchbooking.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/scripts/setbooking.js" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/setbooking.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/style/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.css" 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" />
...@@ -26,8 +22,8 @@ ...@@ -26,8 +22,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/index.html"> <entry file="file://$PROJECT_DIR$/index.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="795"> <state relative-caret-position="90">
<caret line="53" column="44" selection-start-line="53" selection-start-column="44" selection-end-line="53" selection-end-column="44" /> <caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -35,53 +31,17 @@ ...@@ -35,53 +31,17 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/style/style.css"> <entry file="file://$PROJECT_DIR$/style/style.css">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="849"> <state relative-caret-position="764">
<caret line="204" column="1" selection-start-line="204" selection-start-column="1" selection-end-line="204" selection-end-column="1" /> <caret line="204" selection-start-line="204" selection-end-line="204" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/scripts/switchbooking.js">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret selection-end-line="34" selection-end-column="33" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/scripts/data/campsites.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" column="18" selection-start-line="5" selection-start-column="18" selection-end-line="5" selection-end-column="18" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/scripts/filterSites.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1260">
<caret line="84" column="49" selection-start-line="84" selection-start-column="49" selection-end-line="84" selection-end-column="49" />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/scripts/setbooking.js"> <entry file="file://$PROJECT_DIR$/scripts/data/POI.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="7" column="28" selection-start-line="7" selection-start-column="28" selection-end-line="7" selection-end-column="28" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/scripts/data/bookings.json">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360"> <state relative-caret-position="323">
<caret line="24" column="18" lean-forward="true" selection-start-line="24" selection-start-column="18" selection-end-line="24" selection-end-column="18" /> <caret line="46" column="46" lean-forward="true" selection-start-line="46" selection-start-column="46" selection-end-line="46" selection-end-column="46" />
</state> </state>
</provider> </provider>
</entry> </entry>
...@@ -89,8 +49,8 @@ ...@@ -89,8 +49,8 @@
<file pinned="false" current-in-tab="false"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/scripts/map.js"> <entry file="file://$PROJECT_DIR$/scripts/map.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195"> <state relative-caret-position="690">
<caret line="13" column="36" selection-start-line="13" selection-start-column="36" selection-end-line="13" selection-end-column="36" /> <caret line="46" column="9" selection-start-line="46" selection-start-column="9" selection-end-line="46" selection-end-column="9" />
<folding> <folding>
<element signature="e#9#15#0" expanded="true" /> <element signature="e#9#15#0" expanded="true" />
</folding> </folding>
...@@ -113,9 +73,20 @@ ...@@ -113,9 +73,20 @@
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>border</find> <find>border</find>
<find>console.lo</find>
<find>console.log</find> <find>console.log</find>
<find>console</find>
<find>submit</find>
<find>searchpushed</find>
<find>searchPushed</find>
<find>click</find>
<find>console.lo</find>
<find>log</find>
<find>json</find>
<find>map.js:51 You clicked the map at LatLng</find>
</findStrings> </findStrings>
<replaceStrings>
<replace>console</replace>
</replaceStrings>
</component> </component>
<component name="Git.Settings"> <component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" /> <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
...@@ -130,18 +101,20 @@ ...@@ -130,18 +101,20 @@
<option value="$PROJECT_DIR$/scripts/data/tentInfo.html" /> <option value="$PROJECT_DIR$/scripts/data/tentInfo.html" />
<option value="$PROJECT_DIR$/scripts/data/vanInfo.html" /> <option value="$PROJECT_DIR$/scripts/data/vanInfo.html" />
<option value="$PROJECT_DIR$/scripts/leaflet/leafletAjax.js" /> <option value="$PROJECT_DIR$/scripts/leaflet/leafletAjax.js" />
<option value="$PROJECT_DIR$/scripts/map.js" /> <option value="$PROJECT_DIR$/style/style.css" />
<option value="$PROJECT_DIR$/scripts/switchbooking.js" /> <option value="$PROJECT_DIR$/scripts/switchbooking.js" />
<option value="$PROJECT_DIR$/scripts/filterSites.js" />
<option value="$PROJECT_DIR$/index.html" /> <option value="$PROJECT_DIR$/index.html" />
<option value="$PROJECT_DIR$/style/style.css" /> <option value="$PROJECT_DIR$/scripts/filterSites.js" />
<option value="$PROJECT_DIR$/scripts/setbooking.js" /> <option value="$PROJECT_DIR$/scripts/setbooking.js" />
<option value="$PROJECT_DIR$/scripts/data/POI.geojson" />
<option value="$PROJECT_DIR$/scripts/map.js" />
<option value="$PROJECT_DIR$/scripts/data/POI.json" />
</list> </list>
</option> </option>
</component> </component>
<component name="ProjectFrameBounds"> <component name="ProjectFrameBounds">
<option name="y" value="23" /> <option name="y" value="23" />
<option name="width" value="1314" /> <option name="width" value="1189" />
<option name="height" value="1347" /> <option name="height" value="1347" />
</component> </component>
<component name="ProjectLevelVcsManager"> <component name="ProjectLevelVcsManager">
...@@ -152,7 +125,6 @@ ...@@ -152,7 +125,6 @@
<foldersAlwaysOnTop value="true" /> <foldersAlwaysOnTop value="true" />
</navigator> </navigator>
<panes> <panes>
<pane id="Scope" />
<pane id="ProjectPane"> <pane id="ProjectPane">
<subPane> <subPane>
<expand> <expand>
...@@ -165,6 +137,12 @@ ...@@ -165,6 +137,12 @@
<item name="assignment-1" type="462c0819:PsiDirectoryNode" /> <item name="assignment-1" type="462c0819:PsiDirectoryNode" />
<item name="scripts" type="462c0819:PsiDirectoryNode" /> <item name="scripts" type="462c0819:PsiDirectoryNode" />
</path> </path>
<path>
<item name="assignment-1" type="b2602c69:ProjectViewProjectNode" />
<item name="assignment-1" type="462c0819:PsiDirectoryNode" />
<item name="scripts" type="462c0819:PsiDirectoryNode" />
<item name="data" type="462c0819:PsiDirectoryNode" />
</path>
<path> <path>
<item name="assignment-1" type="b2602c69:ProjectViewProjectNode" /> <item name="assignment-1" type="b2602c69:ProjectViewProjectNode" />
<item name="assignment-1" type="462c0819:PsiDirectoryNode" /> <item name="assignment-1" type="462c0819:PsiDirectoryNode" />
...@@ -174,6 +152,7 @@ ...@@ -174,6 +152,7 @@
<select /> <select />
</subPane> </subPane>
</pane> </pane>
<pane id="Scope" />
</panes> </panes>
</component> </component>
<component name="PropertiesComponent"> <component name="PropertiesComponent">
...@@ -223,7 +202,8 @@ ...@@ -223,7 +202,8 @@
<workItem from="1566271563452" duration="7254000" /> <workItem from="1566271563452" duration="7254000" />
<workItem from="1566278943384" duration="34000" /> <workItem from="1566278943384" duration="34000" />
<workItem from="1566340107468" duration="6269000" /> <workItem from="1566340107468" duration="6269000" />
<workItem from="1566359872857" duration="14918000" /> <workItem from="1566359872857" duration="22497000" />
<workItem from="1566431482065" duration="4231000" />
</task> </task>
<task id="LOCAL-00001" summary="First Commit"> <task id="LOCAL-00001" summary="First Commit">
<created>1565679239864</created> <created>1565679239864</created>
...@@ -253,17 +233,31 @@ ...@@ -253,17 +233,31 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1566346446447</updated> <updated>1566346446447</updated>
</task> </task>
<option name="localTasksCounter" value="5" /> <task id="LOCAL-00005" summary="Added filter">
<created>1566375470750</created>
<option name="number" value="00005" />
<option name="presentableId" value="LOCAL-00005" />
<option name="project" value="LOCAL" />
<updated>1566375470750</updated>
</task>
<task id="LOCAL-00006" summary="Added localStorage">
<created>1566383025654</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1566383025654</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers /> <servers />
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="35984000" /> <option name="totallyTimeSpent" value="47794000" />
</component> </component>
<component name="ToolWindowManager"> <component name="ToolWindowManager">
<frame x="0" y="23" width="1314" height="1347" extended-state="0" /> <frame x="0" y="23" width="1189" height="1347" extended-state="0" />
<editor active="true" /> <editor active="true" />
<layout> <layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.2004717" /> <window_info content_ui="combo" id="Project" order="0" visible="true" weight="0.22580644" />
<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" />
...@@ -291,19 +285,11 @@ ...@@ -291,19 +285,11 @@
<MESSAGE value="First Commit" /> <MESSAGE value="First Commit" />
<MESSAGE value="Added form, image and some text" /> <MESSAGE value="Added form, image and some text" />
<MESSAGE value="Finished css, made massive progress" /> <MESSAGE value="Finished css, made massive progress" />
<option name="LAST_COMMIT_MESSAGE" value="Finished css, made massive progress" /> <MESSAGE value="Added filter" />
<MESSAGE value="Added localStorage" />
<option name="LAST_COMMIT_MESSAGE" value="Added localStorage" />
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/scripts/jquery-3.3.1.min.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" selection-start-line="2" selection-end-line="2" />
<folding>
<element signature="n#!!doc" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/scripts/data/cabinInfo.html"> <entry file="file://$PROJECT_DIR$/scripts/data/cabinInfo.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60"> <state relative-caret-position="60">
...@@ -334,23 +320,16 @@ ...@@ -334,23 +320,16 @@
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/scripts/leaflet/leafletAjax.js" /> <entry file="file://$PROJECT_DIR$/scripts/leaflet/leafletAjax.js" />
<entry file="file://$PROJECT_DIR$/scripts/map.js"> <entry file="file://$PROJECT_DIR$/scripts/jquery-3.3.1.min.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="195"> <state relative-caret-position="30">
<caret line="13" column="36" selection-start-line="13" selection-start-column="36" selection-end-line="13" selection-end-column="36" /> <caret line="2" selection-start-line="2" selection-end-line="2" />
<folding> <folding>
<element signature="e#9#15#0" expanded="true" /> <element signature="n#!!doc" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/scripts/data/POI.geojson">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="840">
<caret line="56" column="25" lean-forward="true" selection-start-line="56" selection-start-column="25" selection-end-line="56" selection-end-column="25" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/scripts/data/bookings.json"> <entry file="file://$PROJECT_DIR$/scripts/data/bookings.json">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360"> <state relative-caret-position="360">
...@@ -358,6 +337,9 @@ ...@@ -358,6 +337,9 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/scripts/data/._campsites.json">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/scripts/data/campsites.json"> <entry file="file://$PROJECT_DIR$/scripts/data/campsites.json">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75"> <state relative-caret-position="75">
...@@ -365,38 +347,55 @@ ...@@ -365,38 +347,55 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/index.html"> <entry file="file://$PROJECT_DIR$/scripts/switchbooking.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="795"> <state relative-caret-position="255">
<caret line="53" column="44" selection-start-line="53" selection-start-column="44" selection-end-line="53" selection-end-column="44" /> <caret line="17" column="30" selection-start-line="17" selection-start-column="30" selection-end-line="17" selection-end-column="30" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/style/style.css"> <entry file="file://$PROJECT_DIR$/scripts/setbooking.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="849"> <state relative-caret-position="240">
<caret line="204" column="1" selection-start-line="204" selection-start-column="1" selection-end-line="204" selection-end-column="1" /> <caret line="16" column="5" lean-forward="true" selection-start-line="16" selection-start-column="5" selection-end-line="16" selection-end-column="5" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/scripts/filterSites.js"> <entry file="file://$PROJECT_DIR$/scripts/filterSites.js">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1260"> <state relative-caret-position="210">
<caret line="84" column="49" selection-start-line="84" selection-start-column="49" selection-end-line="84" selection-end-column="49" /> <caret line="14" column="25" lean-forward="true" selection-start-line="14" selection-start-column="25" selection-end-line="14" selection-end-column="25" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/scripts/switchbooking.js"> <entry file="file://$PROJECT_DIR$/index.html">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state> <state relative-caret-position="90">
<caret selection-end-line="34" selection-end-column="33" /> <caret line="6" column="22" selection-start-line="6" selection-start-column="22" selection-end-line="6" selection-end-column="22" />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/scripts/setbooking.js"> <entry file="file://$PROJECT_DIR$/style/style.css">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="764">
<caret line="204" selection-start-line="204" selection-end-line="204" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/scripts/map.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="690">
<caret line="46" column="9" selection-start-line="46" selection-start-column="9" selection-end-line="46" selection-end-column="9" />
<folding>
<element signature="e#9#15#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/scripts/data/POI.json">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105"> <state relative-caret-position="323">
<caret line="7" column="28" selection-start-line="7" selection-start-column="28" selection-end-line="7" selection-end-column="28" /> <caret line="46" column="46" lean-forward="true" selection-start-line="46" selection-start-column="46" selection-end-line="46" selection-end-column="46" />
</state> </state>
</provider> </provider>
</entry> </entry>
......
var Map = (function () { var Map = (function () {
pub = {}; pub = {};
var map;;
pub.setup = function() { pub.setup = function() {
var map = L.map('map').setView([-45.858578, 170.527263], 17.45); map = L.map('map').setView([-45.858578, 170.527263], 17.45);
L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
{ {
maxZoom: 18, maxZoom: 18,
...@@ -10,10 +10,44 @@ var Map = (function () { ...@@ -10,10 +10,44 @@ var Map = (function () {
'<a href="http://www.openstreetmap.org/copyright">' + '<a href="http://www.openstreetmap.org/copyright">' +
"OpenStreetMap contributors</a> CC-BY-SA" "OpenStreetMap contributors</a> CC-BY-SA"
}).addTo(map); }).addTo(map);
centralMarker = L.marker([-45.875, 170.500]).addTo(map);
$.getJSON("scripts/data/POI.json", function(data) {
for (i = 0; i < data.features.length; i++) {
cFeature = data.features[i];
geo = cFeature.geometry;
properties = cFeature.properties;
type = cFeature.type;
createMarker(geo, properties);
console.log("Feature "+i+":");
console.log("Geometry: ");
console.log(geo);
console.log("Properties:");
console.log(properties);
console.log("Type:");
console.log(type);
console.log("------------------");
}
});
centralMarker = L.marker([170.5153065919876,-45.90540437585189]).addTo(map);
map.on("click", onMapClick); map.on("click", onMapClick);
} }
function createMarker(geo, properties) {
marker = L.marker(geo.coordinates).addTo(map);
if (geo.polygon === true) {
shape = L.polygon(geo.polygonCoords).addTo(map);
}
marker.bindPopup("<h2>"+properties.name+"</h2>"+"<p>"+properties.info+"</p>");
}
function onMapClick(e) { function onMapClick(e) {
console.log("You clicked the map at " + e.latlng); console.log("You clicked the map at " + e.latlng);
} }
......
...@@ -6,13 +6,11 @@ var SetBooking= (function () { ...@@ -6,13 +6,11 @@ var SetBooking= (function () {
booking.siteId = $(this).parent().parent().find("td")[0].textContent; booking.siteId = $(this).parent().parent().find("td")[0].textContent;
booking.checkIn = $("#checkIn").val(); booking.checkIn = $("#checkIn").val();
booking.checkOut = $("#checkOut").val(); booking.checkOut = $("#checkOut").val();
console.log(booking);
localStorage.setItem("savedQuickCampBooking", JSON.stringify(booking)) localStorage.setItem("savedQuickCampBooking", JSON.stringify(booking))
} }
pub.updateButtons = function() { pub.updateButtons = function() {
bookButtons = $(".bookButton"); bookButtons = $(".bookButton");
console.log("Length: "+bookButtons.length);
for (i = 0; i < bookButtons.length; i++) { for (i = 0; i < bookButtons.length; i++) {
bookButtons[i].onclick = setBooking; bookButtons[i].onclick = setBooking;
} }
......
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