Skip to content

Commit

Permalink
added ol3.1.1, trying to fix the problem on the updating #39
Browse files Browse the repository at this point in the history
  • Loading branch information
jsanz committed Dec 30, 2014
1 parent c904596 commit 8528457
Show file tree
Hide file tree
Showing 8 changed files with 126,305 additions and 6 deletions.
1 change: 0 additions & 1 deletion ol3/bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"dependencies": {
"bootstrap": "~3.2.0",
"modernizr": "~2.8.3",
"ol3-unofficial": "~3.0.3",
"bootswatch": "~3.2.0",
"selectize": "~0.11.2",
"bootstrap-tour": "~0.10.1",
Expand Down
4 changes: 2 additions & 2 deletions ol3/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<!-- build:css styles/style.min.css -->
<!-- bower:css -->
<link rel="stylesheet" href="lib/bootstrap/dist/css/bootstrap.css" />
<link rel="stylesheet" href="lib/ol3-unofficial/ol.css" />
<link rel="stylesheet" href="scripts/ol3.1.1/ol.css" />
<link rel="stylesheet" href="lib/selectize/dist/css/selectize.bootstrap3.css" />
<link rel="stylesheet" href="lib/bootstrap-tour/build/css/bootstrap-tour.css" />
<link rel="stylesheet" href="lib/alertifyjs/dist/css/alertify-bootstrap-3.css" />
Expand Down Expand Up @@ -385,7 +385,7 @@ <h4 class="modal-title" id="myModalLabel">An error on an school address or posit
<script src="lib/selectize/dist/js/standalone/selectize.js"></script>
<script src="lib/bootstrap-tour/build/js/bootstrap-tour.js"></script>
<script src="lib/alertifyjs/dist/js/alertify.js"></script>
<script src="lib/ol3-unofficial/ol.js"></script>
<script src="scripts/ol3.1.1/ol.js"></script>
<!-- endbower -->
<!-- endbuild -->
<!-- build:js scripts/app.min.js -->
Expand Down
16 changes: 14 additions & 2 deletions ol3/src/scripts/antipodemap.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,17 @@ AntipodeMap.prototype.setupSelectize = function() {
var select;
if (opts.properties.mun) {
select = 'SELECT ' + opts.properties.id + ', ' +
opts.properties.name + ' || \' (\' || ' + opts.properties.mun + ' || \' )\' as ' + opts.properties.name;
opts.properties.name + ' || \' (\' || ' + opts.properties.mun + ' || \')\' as ' + opts.properties.name;
} else {
select = 'SELECT ' + opts.properties.id + ', ' + opts.properties.name;
}
var sql = 'WITH Q AS (' + opts.cartodb.sql + ') ' +
select +
' FROM Q WHERE ' + opts.properties.name +
' ~~* \'%' + query + '%\' ORDER BY 2 LIMIT 10';
console.log("combo: " + sql);
if (ctx.verbose){
console.log("combo: " + sql);
}
$.ajax({
url: 'https://'+ ctx.maps.opts.cartodb.user + '.cartodb.com/api/v2/sql?q=' + encodeURIComponent(sql),
type: 'GET',
Expand Down Expand Up @@ -120,6 +122,9 @@ AntipodeMap.prototype.setupMap = function() {
}
]}
// Promise object to load
if (this.verbose){
console.log("Loading configuration...");
}
var loader = Promise.resolve($.ajax({
url: 'https://'+ user + '.cartodb.com/api/v1/map?config=' +
encodeURIComponent(JSON.stringify(configObj)),
Expand Down Expand Up @@ -161,6 +166,13 @@ AntipodeMap.prototype.setupMap = function() {
context.moveMap(map.getCoordinateFromPixel(evt.pixel));
});

map.on('pointermove', function(event) {
//debugger
var coord3857 = event.coordinate;
var coord4326 = ol.proj.transform(coord3857, 'EPSG:3857', 'EPSG:4326');
$('#' + context.opts.div + '-details .mouseposition').text(ol.coordinate.toStringXY(coord4326, 4));
});

this.setupOverlay();
};

Expand Down
5 changes: 4 additions & 1 deletion ol3/src/scripts/antipodemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ AntipodesMaps.prototype.setUpTriggers = function(antipodeMap){
if (! ctx.lastDistSQL){
ctx.lastDistSQL = now;
doIt = true;
} else if (ctx.lastDistSQL && (now - ctx.lastDistSQL) > 100 ){
} else if (ctx.lastDistSQL && (now - ctx.lastDistSQL) > 200 ){
doIt = true;
}

Expand Down Expand Up @@ -101,6 +101,9 @@ AntipodesMaps.prototype.setUpTriggers = function(antipodeMap){
AntipodesMaps.prototype.sqlLoader = function(sql,isGeoJSON) {
var geojson = isGeoJSON ? "&format=geojson" : "";
var url = 'https://'+ this.opts.cartodb.user + '.cartodb.com/api/v2/sql?q=' + encodeURIComponent(sql) + geojson;
if (this.verbose){
console.log("sqlLoader: " + sql);
}
return $.ajax({
url: url,
contentType: 'text/plain',
Expand Down
Loading

0 comments on commit 8528457

Please sign in to comment.