Skip to content

Commit

Permalink
Release 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kochizufan committed Jun 4, 2019
1 parent d5658d1 commit 5591fcc
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 62 deletions.
26 changes: 13 additions & 13 deletions dist/maplat.js

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/maplat_core.js

Large diffs are not rendered by default.

Binary file modified example.zip
Binary file not shown.
43 changes: 22 additions & 21 deletions js/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
sourcePromise.push(ol.source.HistMap.createAsync(option, commonOption));
}

return Promise.all(sourcePromise).then(function (sources) {
app.mercSrc = sources.reduce(function (prev, curr) {
return Promise.all(sourcePromise).then(function(sources) {
app.mercSrc = sources.reduce(function(prev, curr) {
if (prev) return prev;
if (curr instanceof ol.source.NowMap) return curr;
}, null);
Expand All @@ -362,7 +362,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
app.dispatchEvent(new CustomEvent('sourceLoaded', sources));

var initial = app.initialRestore.sourceID || app.startFrom || cache[cache.length - 1].sourceID;
app.from = cache.reduce(function (prev, curr) {
app.from = cache.reduce(function(prev, curr) {
if (prev) {
return !(prev instanceof ol.source.HistMap) && curr.sourceID != initial ? curr : prev;
}
Expand All @@ -374,7 +374,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
app.mapObject.on('click', function(evt) {
app.logger.debug(evt.pixel);
var feature = this.forEachFeatureAtPixel(evt.pixel,
function (feature) {
function(feature) {
app.logger.debug(evt.pixel);
if (feature.get('datum')) return feature;
});
Expand All @@ -383,7 +383,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
} else {
var xy = evt.coordinate;
app.dispatchEvent(new CustomEvent('clickMapXy', xy));
app.from.xy2MercAsync(xy).then(function (merc) {
app.from.xy2MercAsync(xy).then(function(merc) {
app.dispatchEvent(new CustomEvent('clickMapMerc', merc));
var lnglat = ol.proj.transform(merc, 'EPSG:3857', 'EPSG:4326');
app.dispatchEvent(new CustomEvent('clickMap', {
Expand Down Expand Up @@ -452,7 +452,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {

// MapUI on off
var timer;
app.mapObject.on('click', function () {
app.mapObject.on('click', function() {
if (timer) {
clearTimeout(timer);
delete timer;
Expand All @@ -462,7 +462,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
ctls[i].classList.remove('fade');
}
});
app.mapObject.on('pointerdrag', function () {
app.mapObject.on('pointerdrag', function() {
if (timer) {
clearTimeout(timer);
delete timer;
Expand All @@ -472,12 +472,12 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
ctls[i].classList.add('fade');
}
});
app.mapObject.on('moveend', function () {
app.mapObject.on('moveend', function() {
if (timer) {
clearTimeout(timer);
delete timer;
}
timer = setTimeout(function () {
timer = setTimeout(function() {
delete timer;
var ctls = app.mapDivDocument.querySelectorAll('.ol-control');
for (var i = 0; i < ctls.length; i++) {
Expand All @@ -487,13 +487,13 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
});

// change mouse cursor when over marker
var moveHandler = function (evt) {
var moveHandler = function(evt) {
var pixel = this.getEventPixel(evt.originalEvent);
var hit = this.hasFeatureAtPixel(pixel);
var target = this.getTarget();
if (hit) {
var feature = this.forEachFeatureAtPixel(evt.pixel,
function (feature) {
function(feature) {
if (feature.get('datum')) return feature;
});
app.mapDivDocument.querySelector('#' + target).style.cursor = feature ? 'pointer' : '';
Expand All @@ -503,7 +503,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
};
app.mapObject.on('pointermove', moveHandler);

var mapOutHandler = function (evt) {
var mapOutHandler = function(evt) {
var histCoord = evt.frameState.viewState.center;
var source = app.from;
if (!source.insideCheckHistMapCoords(histCoord)) {
Expand All @@ -513,7 +513,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
};
app.mapObject.on('moveend', mapOutHandler);

var backMapMove = function (evt) {
var backMapMove = function(evt) {
if (!app.backMap) return;
if (this._backMapMoving) {
app.logger.debug('Backmap moving skipped');
Expand All @@ -524,7 +524,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
this._backMapMoving = true;
app.logger.debug('Backmap moving started');
var self = this;
app.convertParametersFromCurrent(backSrc, function (size) {
app.convertParametersFromCurrent(backSrc, function(size) {
var view = app.backMap.getView();
view.setCenter(size[0]);
view.setZoom(size[1]);
Expand All @@ -536,14 +536,14 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
};
app.mapObject.on('postrender', backMapMove);

app.mapObject.on('postrender', function (evt) {
app.mapObject.on('postrender', function(evt) {
var view = app.mapObject.getView();
var center = view.getCenter();
var zoom = view.getDecimalZoom();
var rotation = normalizeDegree(view.getRotation() * 180 / Math.PI);
app.from.size2MercsAsync().then(function (mercs) {
app.from.size2MercsAsync().then(function(mercs) {
return app.mercSrc.mercs2SizeAsync(mercs);
}).then(function (size) {
}).then(function(size) {
if (app.mobileMapMoveBuffer && app.mobileMapMoveBuffer[0][0] == size[0][0] &&
app.mobileMapMoveBuffer[0][1] == size[0][1] &&
app.mobileMapMoveBuffer[1] == size[1] &&
Expand Down Expand Up @@ -640,17 +640,18 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
app.__selectedMarker == data.namespace_id ? 'parts/defaultpin_selected.png' : 'parts/defaultpin.png';
var promise = coords ?
(function() {
return src.merc2XyAsync(coords);
return src.merc2XyAsync(coords, true);
})() :
(x && y) ?
new Promise(function(resolve) {
resolve(src.xy2HistMapCoords([x, y]));
}) :
(function() {
var merc = ol.proj.transform(lnglat, 'EPSG:4326', 'EPSG:3857');
return src.merc2XyAsync(merc);
return src.merc2XyAsync(merc, true);
})();
promise.then(function(xy) {
if (!xy) return;
if (src.insideCheckHistMapCoords(xy)) {
app.mapObject.setMarker(xy, {'datum': data}, icon);
}
Expand Down Expand Up @@ -710,7 +711,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
Object.keys(source.pois).map(function(key) {
var cluster = source.pois[key];
if (!cluster.hide) {
cluster.pois.map(function (data) {
cluster.pois.map(function(data) {
var dataCopy = Object.assign({}, data);
if (!dataCopy.icon) {
dataCopy.icon = cluster.icon;
Expand Down Expand Up @@ -1123,7 +1124,7 @@ define(['histmap', 'i18n', 'i18nxhr'], function(ol, i18n, i18nxhr) {
app.__init = false;
to.goHome();
} else if (app.backMap && backTo) {
app.convertParametersFromCurrent(backTo, function (size) {
app.convertParametersFromCurrent(backTo, function(size) {
var view = app.backMap.getView();
view.setCenter(size[0]);
view.setZoom(size[1]);
Expand Down
3 changes: 2 additions & 1 deletion js/histmap_tin.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ define(['histmap', 'tin', 'turf'], function(ol, Tin, turf) {
return ret[1];
});
};
ol.source.HistMap.prototype.merc2XyAsync = function(merc) {
ol.source.HistMap.prototype.merc2XyAsync = function(merc, ignoreBackside) {
var self = this;
return this.merc2XyAsync_returnLayer(merc).then(function(ret){
if (ignoreBackside && !ret[0]) return;
var convertXy = !ret[0] ? ret[1][1] : ret[0][1];
return self.xy2HistMapCoords(convertXy);
}).catch(function(err) { throw err; });
Expand Down
2 changes: 1 addition & 1 deletion mobile_android/mobile_android_lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'maven'

def VERSION_NAME = "0.5.0"
def VERSION_NAME = "0.5.1"

android {
compileSdkVersion 27
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mobile_ios/mobile_ios_lib/MaplatView/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.5.0</string>
<string>0.5.1</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Maplat",
"description": "Maplat is the cool Historical Map/Illustrated Map Viewer. It can transform each map coordinates with nonlinear but bijective projection and makes possible that the maps can collaborate with GPS/accurate maps, without distorting original maps. Data editor of this solution is provided as another project, MaplatEditor.",
"version": "0.5.0",
"version": "0.5.1",
"homepage": "https://github.com/code4nara/Maplat/wiki",
"license": "MIT",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ workbox.clientsClaim();
self.__precacheManifest = [
{
"url": ".",
"revision": "Mon May 27 2019 15:14:34 GMT+0900 (GMT+09:00)"
"revision": "Tue Jun 04 2019 22:48:38 GMT+0900 (GMT+09:00)"
},
{
"url": "dist/maplat.js",
"revision": "c99e948caed2fa50824cd638e8dd4256"
"revision": "14de8de8848faba2bbbe884ad6d854b2"
},
{
"url": "dist/maplat.css",
Expand Down

0 comments on commit 5591fcc

Please sign in to comment.