jetherton / wtm

Watch the Med
Other
0 stars 0 forks source link

Ruler on maps #4

Closed jetherton closed 11 years ago

jetherton commented 11 years ago

Button that floats on the maps that measures distance between points on a map

http://openlayers.org/dev/examples/measure.html

jetherton commented 11 years ago

So the problem with reports/view/X is that the map is wrapped in an Ushahidi object which is defined in /media/js/ushahidi.js. It doesn't seem they make the open layers map object available, which is lame.

I ended up having to mess with the view file /themes/wtm/views/reports/view_js.php and created a myMap variable that gets the map._olMap and stores that for our plugin to use later on. This one was weird and way harder than it should have been.

Everything else looks great. Nice work.

jetherton commented 11 years ago

Also, don't forget that there is a map on the /admin/reports/edit page.

jetherton commented 11 years ago

Don't use what you're doing is creating two tags in the page, that's invalid HTML. Most browsers can handle that. What you should do is $(window).load(function(){ruler();});

Also, when the wide map on by default plugin redraws the /reports/submit map, the ruler gets put in the wrong place. Can you fix that.

Dylan-Gillespie commented 11 years ago

fa3d826 Should have rulers work with all default maps and this commit fixes some spacing issues on reports/view