Skip to content

Commit

Permalink
a little fix (working now...)
Browse files Browse the repository at this point in the history
  • Loading branch information
ponkore committed Feb 26, 2014
1 parent 8fb2881 commit a3512c4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
16 changes: 8 additions & 8 deletions resources/public/jrw-lines-example.html
Expand Up @@ -3,18 +3,18 @@
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to mapmap</title>
</head>
<body>
<!-- navbar -->
<div class="container">
<div id="map" style="width: 100%; height: 100%; border: 1px solid black;"></div>
<script type="text/javascript" src="/js/jrw-lines-example.js"></script>
</div>
<!-- scripts and styles -->
<script src="//code.jquery.com/jquery-2.0.3.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/screen.css">
<script type="text/javascript" src="/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div id="map" style="width: 100%; height: 400px; border: 1px solid black;"></div>
<script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script>
<script type="text/javascript" src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script>
<script type="text/javascript" src="/js/jrw-lines-example.js"></script>
</div>
</body>
</html>
10 changes: 8 additions & 2 deletions resources/public/js/jrw-lines-example.js
Expand Up @@ -86,7 +86,7 @@ $(function() {

function mapZoomEnd(event) {
// log(event.type + "/" + map.numZoomLevels + "/" + map.getZoom());
var displayStationLabel = (map.getZoom() > 12);
// var displayStationLabel = (map.getZoom() > 12);
}

// function log(msg) {
Expand All @@ -103,25 +103,31 @@ $(function() {
"JRW-005-himisen.geojson",
"JRW-006-takayamasen.geojson",
"JRW-007-ooitosen.geojson",
*/
"JRW-008-kansaisen.geojson",
/*
"JRW-009-kusatsusen.geojson",
"JRW-010-narasen.geojson",
"JRW-011-sakuraisen.geojson",
"JRW-012-wakayamasen.geojson",
*/
"JRW-013-hanwasen.geojson",
"JRW-014-kiseisen.geojson",
"JRW-015-tokaidosen.geojson",
"JRW-016-koseisen.geojson",
"JRW-017-fukuchiyamasen.geojson",
/*
"JRW-018-obamasen.geojson",
"JRW-019-kakogawasen.geojson",
"JRW-020-bantansen.geojson",
"JRW-021-maizurusen.geojson",
*/
"JRW-022-kanjosen.geojson",
"JRW-023-katamachisen.geojson",
"JRW-024-tozaisen.geojson",
"JRW-025-oosakahigashisen.geojson",
"JRW-026-sanyosen.geojson",
/*
"JRW-027-kishinsen.geojson",
"JRW-028-akosen.geojson",
"JRW-029-tsuyamasen.geojson",
Expand Down Expand Up @@ -149,7 +155,7 @@ $(function() {
$.each(urls, function(i, val) {
var layer = new OpenLayers.Layer.Vector("L" + i, { styleMap: composedDrawStyle });
map.addLayer(layer);
var file = "/map/" + val; // TODO: ajax化
var file = "/map/" + val;
create_features(file, feature_composed_fn, layer);
});
});
6 changes: 3 additions & 3 deletions src/mapmap/routes/map.clj
Expand Up @@ -5,8 +5,8 @@

(defn map-page
"returns JSON string"
[id]
(slurp (str "src/mapmap/model/json/" id)))
[params]
(slurp (str "src/mapmap/model/json/" (get-in params [:params :id]))))

(defroutes map-routes
(GET "/map/:id" id (map-page id)))
(GET "/map/:id" params (map-page params)))

0 comments on commit a3512c4

Please sign in to comment.