Show OpenStreetMap maps on event pages. #554

Closed
wants to merge 4 commits into
from

Conversation

Projects
None yet
3 participants
@derickr
Contributor

derickr commented Nov 10, 2012

This pull request adds showing an OpenStreetMap based map on the event view page. It also replaces the GoogleMaps solution on the event edit page with one using OpenStreetMap for the map and Nominatim for the address search box.

derickr added some commits Oct 24, 2012

Show OpenStreetMap maps on event pages.
This is the first part of it, the event edit page should also still
be updated to use OpenStreetMap, but this is a good and finished step
for showing it on the non-admin parts of the site.

(Also thanks to Kat for all the jquery magic!)
@@ -0,0 +1,12 @@
+#map {
+ height: 200px;
+ width: 350px;

This comment has been minimized.

Show comment Hide comment
@akrabat

akrabat Nov 19, 2012

Owner

On my browser, the "Powered by Leaflet — Map data © 2012 OpenStreetMap contributors" text wraps onto a second line. If you make the width 360px, this doesn't happen.

@akrabat

akrabat Nov 19, 2012

Owner

On my browser, the "Powered by Leaflet — Map data © 2012 OpenStreetMap contributors" text wraps onto a second line. If you make the width 360px, this doesn't happen.

This comment has been minimized.

Show comment Hide comment
@derickr

derickr Nov 19, 2012

Contributor

On Mon, 19 Nov 2012, Rob Allen wrote:

@@ -0,0 +1,12 @@
+#map {

  • height: 200px;
  • width: 350px;

On my browser, the "Powered by Leaflet — Map data © 2012 OpenStreetMap
contributors" text wraps onto a second line. If you make the width
360px, this doesn't happen.

Shouldn't be necessairy now, as the "2012" is gone.

cheers,
Derick

@derickr

derickr Nov 19, 2012

Contributor

On Mon, 19 Nov 2012, Rob Allen wrote:

@@ -0,0 +1,12 @@
+#map {

  • height: 200px;
  • width: 350px;

On my browser, the "Powered by Leaflet — Map data © 2012 OpenStreetMap
contributors" text wraps onto a second line. If you make the width
360px, this doesn't happen.

Shouldn't be necessairy now, as the "2012" is gone.

cheers,
Derick

This comment has been minimized.

Show comment Hide comment
@akrabat

akrabat Nov 20, 2012

Owner

Yes. It no longer wraps for me.

@akrabat

akrabat Nov 20, 2012

Owner

Yes. It no longer wraps for me.

src/inc/js/event_osm_map.js
+ map = new L.Map('map_canvas', {zoomControl: true});
+
+ var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
+ osmAttribution = 'Map data &copy; 2012 <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',

This comment has been minimized.

Show comment Hide comment
@akrabat

akrabat Nov 19, 2012

Owner

Do we need to remember to change this to the correct year every January 1st ?

@akrabat

akrabat Nov 19, 2012

Owner

Do we need to remember to change this to the correct year every January 1st ?

This comment has been minimized.

Show comment Hide comment
@derickr

derickr Nov 19, 2012

Contributor

On Mon, 19 Nov 2012, Rob Allen wrote:

@@ -0,0 +1,65 @@
+var map;
+var marker;
+
+function load_map() {

  • var lat = $('#map_latitude').val();
  • var lon = $('#map_longitude').val();
  • var zoomLevel = parseInt($('#map_zoom').val());
  • map = new L.Map('map_canvas', {zoomControl: true});
  • var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
  •    osmAttribution = 'Map data &copy; 2012 <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',
    

Do we need to remember to change this to the correct year every January 1st ?

I've fixed that now in my PR.

cheers,
Derick

@derickr

derickr Nov 19, 2012

Contributor

On Mon, 19 Nov 2012, Rob Allen wrote:

@@ -0,0 +1,65 @@
+var map;
+var marker;
+
+function load_map() {

  • var lat = $('#map_latitude').val();
  • var lon = $('#map_longitude').val();
  • var zoomLevel = parseInt($('#map_zoom').val());
  • map = new L.Map('map_canvas', {zoomControl: true});
  • var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
  •    osmAttribution = 'Map data &copy; 2012 <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',
    

Do we need to remember to change this to the correct year every January 1st ?

I've fixed that now in my PR.

cheers,
Derick

@lornajane

This comment has been minimized.

Show comment Hide comment
@lornajane

lornajane Nov 20, 2012

Owner

This displays a blank map when there's no location with an event. We need to handle the missing data case (and Kat is looking at this now so I hope there will be a new pull request from her ... keep you posted)

Owner

lornajane commented Nov 20, 2012

This displays a blank map when there's no location with an event. We need to handle the missing data case (and Kat is looking at this now so I hope there will be a new pull request from her ... keep you posted)

@lornajane lornajane closed this Nov 20, 2012

@lornajane

This comment has been minimized.

Show comment Hide comment
@lornajane

lornajane Nov 21, 2012

Owner

New pull request: joindin#587

Owner

lornajane commented Nov 21, 2012

New pull request: joindin#587

@lornajane lornajane reopened this Nov 21, 2012

@lornajane lornajane closed this Nov 21, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment