Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid map for geolocalization #46

Open
wants to merge 55 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
d4dc3e4
actualizados ficheros de la práctica
Nov 27, 2013
6b3dc8a
añadidos ficheros js de los widgets
Nov 27, 2013
eace19a
index.html y reuters.js actualizados
Nov 27, 2013
d4c62f5
actualizado ResultWidget.js
Nov 27, 2013
fcd9a13
reunion 27/11
Nov 27, 2013
cb0f8b5
clase jueves. funcional
Nov 28, 2013
18e3ded
borrar fichero emacs temporal
Nov 28, 2013
e138a3d
Remove only the current geoLoc filter query
Gabriel-PBSL Nov 30, 2013
99f7ef0
Refactor de codigo
Gabriel-PBSL Nov 30, 2013
f239bee
Now the map clear previous markers
Gabriel-PBSL Dec 1, 2013
876952f
restriccion zoom y bounds para el mapa
Dec 12, 2013
aa04b97
mapa cuadrado
Dec 12, 2013
97f4d52
funcionan los facets lat long con la fq del update
Gabriel-PBSL Dec 16, 2013
681a835
facets and clusterization added
Gabriel-PBSL Dec 16, 2013
83b0c12
arreglado error objetoJson not defined
Dec 17, 2013
5ec9fd2
arreglado error value not defined
Dec 17, 2013
a112bd2
hacemos valor absoluto de los steps para evitar bucles infinitos
Dec 17, 2013
31af73b
se eliminan los marcadores anteriores al hacer update
Dec 17, 2013
60a76f5
arreglada grilla
Dec 17, 2013
aa147c1
arreglado bucle de nobledemon
Gabriel-PBSL Dec 17, 2013
97b8e6e
automatic identation of MapQuery.js with emacs
Dec 17, 2013
3fb1fbf
optimized index in solr and javascript
Gabriel-PBSL Dec 18, 2013
50812c6
Merge branch 'master' of https://github.com/Gabriel-PBSL/ajax-solr
Gabriel-PBSL Dec 18, 2013
9cf984d
markers con colores. TODO: codigo de colores
Gabriel-PBSL Dec 18, 2013
6a7133a
regression of markers, are not working yet. Zoom was upside down
Dec 18, 2013
22c32bf
first query of the app was not efficient. osm bridge deleted
Dec 18, 2013
60bf2c1
prove with circle markers
Gabriel-PBSL Dec 19, 2013
54437b6
three types of colors working. osm seems to be inefficient now
Dec 19, 2013
a8c3616
fixed very inefficient search bug
Dec 20, 2013
33494f4
improve delete markers. Needed for interaction with search widget
Dec 20, 2013
432cc9e
version funcional sin pulir
Gabriel-PBSL Dec 20, 2013
276e6a7
eliminado undefinned al principio de los comentarios
Dec 20, 2013
b790326
Merge branch 'master' of https://github.com/Gabriel-PBSL/ajax-solr
Dec 20, 2013
3a8fb28
Code refactored and cleaned
Gabriel-PBSL Dec 20, 2013
3d67b19
Merge branch 'master' of https://github.com/Gabriel-PBSL/ajax-solr
Gabriel-PBSL Dec 20, 2013
9e8cb3b
MapQuery.js indentado correctamente
Dec 20, 2013
831ec46
more translations spanish -> english for MapQuery
Dec 20, 2013
d638f4c
clean reuters.js file
Dec 20, 2013
98bbf85
MapQuery: kill tabs, enjoy 4-spaces. reuters: reclean
Dec 20, 2013
4214c3b
show pager in the app
Dec 20, 2013
9b27a58
new functionality: click to marker, then zoom, center map at this pos…
Dec 20, 2013
986a6ba
rename widget MapQuery to GeoMapGrid
Dec 20, 2013
8b10074
rm MapQuery.js
Dec 20, 2013
d6988bd
preparation of the widget for generic use
Dec 20, 2013
f0206c2
untabify reuters.js and GeoMapGrid.js
Dec 20, 2013
51995b2
we have an error with " character, we have to solve it. this commit d…
Dec 20, 2013
b3d0acd
Corregidas variables
Gabriel-PBSL Dec 20, 2013
01afded
corregido error tipográfico
Gabriel-PBSL Dec 20, 2013
5d395f1
default values for the widget inserted in reuters.js
Dec 20, 2013
4345835
añadido Readme2.md
Gabriel-PBSL Dec 23, 2013
29a40be
Merge branch 'master' of https://github.com/Gabriel-PBSL/ajax-solr
Gabriel-PBSL Dec 23, 2013
9941ccb
Corrected some errors in Readme
Dec 24, 2013
118656e
added jquery to ajax-solr directory
Dec 24, 2013
d885d14
Merge branch 'master' of https://github.com/Gabriel-PBSL/ajax-solr
Dec 24, 2013
ad12e61
Update Readme2.md
nobledemon Dec 24, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions Readme2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
What GeoMapGrid is about?
---

This widget shows little markers in a world map related to the geolocation info of the elements found and shows its quantity. The size and color of the markers is related to the number of elements.

The widget is meant for use with the [AJAX-solr](https://github.com/evolvingweb/ajax-solr) project. Inheriting the AbstractWidget class our widget uses [Leaflet.js](http://leafletjs.com/) to show markers on a [OpenStreetMap](http://www.openstreetmap.org/) world map.
Initially we thought of using GoogleMaps but we ended up using OSM due to its open data license (fitting given that we're doing this as a free software course assignment).

Prerequisites
---
To use GeoMapGrid you need:

* Solr (we used stable version 4.5.1)
* AJAX-Solr (forked, last official commit 866fcd1901d9867b678277a9c5cdaf93c6196246)
* Browser (we used latest stable versions of Firefox and Chromium corresponding to date 2013-12-23)
* jQuery (we used Jquery 2.0.3, is included in ajax-solr directory for off-line working, in 'jquery' directory)
* Leaflet and leaflet.markercluster (version 0.6.4 , is included in ajax-solr directory for off-line working, in 'jquery' directory)
* Internet connection to load osm.org

How to install
---

The installation is quite easy:
First you have to add the widget on the AJAX-solr Manager like in the following:

```
Manager.addWidget(new AjaxSolr.GeoMapGrid({
id: 'map',
target: '#map',
_lat: ['_lat_zero','_lat'],
_long: ['_long_zero','_long'],
geo_loc: ['geo_loc'],
gridSize: 5,
zoomThreshold: 5,
}));
```

You have to set the variable names, you can use the same in solr, or different, but the variable has to be the same.
You have to provide ip for the solr instance and collection: for example,

solrUrl: 'http://1.2.3.4:8080/solr/collection1/'

To link your solr variables to this widget, consider:
* geo\_loc, latitude and longitude of the type: string like: "41.981795,2.823699" we get this from our database with (latitude and longitude are geopoints): SELECT CAST( CONCAT( X( geo\_pt ) , ',', Y( geo\_pt ) ) AS CHAR ) as geo\_loc
* \_lat\_zero (\_lat[0]), \_long\_zero (_long[0]) are latitude and longitude of type int
* \_lat (\_lat[1]), \_long (\_long[1]) that are latitude and longitude of type double/float
* Also, you can change the default valued: gridSize (number of grid subdivisions) and zoomThreshold (zoom where we change from integer values to double values in the facet query)


How to use
---

The widget consist of two filters:

* At every moment you can geolocalize comments with a particular search for words. Enter words and press enter.
* Also, with OSM interface you can navigate the map. Press update to do a geolocalization filter with the current bounds of the map

After applying this filters it will appear in 'current selection', only can be found a filter of every type (by word and geofilter). New filter replace the last of the same type. Also you can delete one of the two filters (press X in the current selection part)
38 changes: 38 additions & 0 deletions examples/reuters/css/MarkerCluster.Default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.marker-cluster-small {
background-color: rgba(181, 226, 140, 0.6);
}
.marker-cluster-small div {
background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-medium {
background-color: rgba(241, 211, 87, 0.6);
}
.marker-cluster-medium div {
background-color: rgba(240, 194, 12, 0.6);
}

.marker-cluster-large {
background-color: rgba(253, 156, 115, 0.6);
}
.marker-cluster-large div {
background-color: rgba(241, 128, 23, 0.6);
}

.marker-cluster {
background-clip: padding-box;
border-radius: 20px;
}
.marker-cluster div {
width: 30px;
height: 30px;
margin-left: 5px;
margin-top: 5px;

text-align: center;
border-radius: 15px;
font: 12px "Helvetica Neue", Arial, Helvetica, sans-serif;
}
.marker-cluster span {
line-height: 30px;
}
6 changes: 6 additions & 0 deletions examples/reuters/css/MarkerCluster.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.leaflet-cluster-anim .leaflet-marker-icon, .leaflet-cluster-anim .leaflet-marker-shadow {
-webkit-transition: -webkit-transform 0.25s ease-out, opacity 0.25s ease-in;
-moz-transition: -moz-transform 0.25s ease-out, opacity 0.25s ease-in;
-o-transition: -o-transform 0.25s ease-out, opacity 0.25s ease-in;
transition: transform 0.25s ease-out, opacity 0.25s ease-in;
}
Loading