Skip to content

Commit

Permalink
Merge pull request #4 from jonataswalker/messy
Browse files Browse the repository at this point in the history
Release v1.4.1
  • Loading branch information
jonataswalker committed Nov 18, 2015
2 parents db39dde + 4900486 commit 0a8ed49
Show file tree
Hide file tree
Showing 8 changed files with 834 additions and 894 deletions.
1,550 changes: 771 additions & 779 deletions build/ol3-geocoder-debug.js

Large diffs are not rendered by default.

7 changes: 2 additions & 5 deletions build/ol3-geocoder.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
width: 31px;
height: 31px;
overflow: hidden;
-webkit-transition: width .2s, height .2s;
transition: width .2s, height .2s;
transition: width .2s, height .2s;
}
.ol-geocoder-search-expanded {
width: 220px;
Expand Down Expand Up @@ -52,9 +51,7 @@ ul.ol-geocoder-result {
overflow-x: hidden;
overflow-y: auto;

-webkit-transition: height 300ms ease-in;

transition: height 300ms ease-in;
transition: height 300ms ease-in;
}
ul.ol-geocoder-result li {
width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion build/ol3-geocoder.js

Large diffs are not rendered by default.

30 changes: 0 additions & 30 deletions combine.js

This file was deleted.

4 changes: 2 additions & 2 deletions examples/control-nominatim.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/ol3/3.8.2/ol.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/ol3/3.11.1/ol.min.css">
<link href="//fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link rel="stylesheet" href="./../build/ol3-geocoder.css">
<link rel="stylesheet" href="control-nominatim.css">
Expand All @@ -14,7 +14,7 @@
<a href="#" id="popup-closer" class="ol-popup-closer"></a>
<div id="popup-content"></div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/ol3/3.8.2/ol.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ol3/3.11.1/ol.min.js"></script>
<script src="./../build/ol3-geocoder.js"></script>
<script src="control-nominatim.js"></script>
</body>
Expand Down
119 changes: 57 additions & 62 deletions examples/control-nominatim.js
Original file line number Diff line number Diff line change
@@ -1,67 +1,62 @@
(function(win, doc){
'use strict';

var
olview = new ol.View({
center: [0, 0],
zoom: 3,
minZoom: 2,
maxZoom: 20
}),
baseLayer = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
}),
map = new ol.Map({
target: doc.getElementById('map'),
view: olview,
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
layers: [baseLayer]
})
;

//Instantiate with some options and add the Control
var geocoder = new Geocoder('nominatim', {
provider: 'photon',
lang: 'en',
placeholder: 'Search for ...',
limit: 5,
keepOpen: true
});
map.addControl(geocoder);

//Listen when an address is chosen
geocoder.on('change:geocoder', function(evt){
var
feature_id = evt.target.get('geocoder'),
feature = geocoder.getSource().getFeatureById(feature_id),
address_html = feature.get('address_html'),
address_obj = feature.get('address_obj'),
address_original = feature.get('address_original'),
coord = feature.getGeometry().getCoordinates()
;
content.innerHTML = '<p>'+address_html+'</p>';
overlay.setPosition(coord);

console.info(address_obj);
});
'use strict';

var
olview = new ol.View({
center: [0, 0],
zoom: 3,
minZoom: 2,
maxZoom: 20
}),
baseLayer = new ol.layer.Tile({
source: new ol.source.MapQuest({layer: 'osm'})
}),
map = new ol.Map({
target: doc.getElementById('map'),
view: olview,
loadTilesWhileAnimating: true,
loadTilesWhileInteracting: true,
layers: [baseLayer]
})
;

/**
* Popup
**/
//Instantiate with some options and add the Control
var geocoder = new Geocoder('nominatim', {
provider: 'photon',
lang: 'en',
placeholder: 'Search for ...',
limit: 5,
keepOpen: true
});
map.addControl(geocoder);

//Listen when an address is chosen
geocoder.on('addresschosen', function(evt){
var
container = doc.getElementById('popup'),
content = doc.getElementById('popup-content'),
closer = doc.getElementById('popup-closer'),
overlay = new ol.Overlay({
element: container,
offset: [0, -40]
})
feature = evt.feature,
coord = evt.coordinate,
address_html = feature.get('address_html')
;
closer.onclick = function() {
overlay.setPosition(undefined);
closer.blur();
return false;
};
map.addOverlay(overlay);
content.innerHTML = '<p>'+address_html+'</p>';
overlay.setPosition(coord);
});

/**
* Popup
**/
var
container = doc.getElementById('popup'),
content = doc.getElementById('popup-content'),
closer = doc.getElementById('popup-closer'),
overlay = new ol.Overlay({
element: container,
offset: [0, -40]
})
;
closer.onclick = function() {
overlay.setPosition(undefined);
closer.blur();
return false;
};
map.addOverlay(overlay);
})(window, document);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ol3-geocoder",
"version": "1.4.0",
"version": "1.4.1",
"description": "A geocoder extension for OpenLayers 3.",
"main": "ol3-geocoder.js",
"author": "Jonatas Walker",
Expand Down
14 changes: 0 additions & 14 deletions src/wrapper.js

This file was deleted.

0 comments on commit 0a8ed49

Please sign in to comment.