It was a long time ago and i steel working on the same project, but i have done a new function for the file media/js/ushahidi.js:Ushahidi.Map.prototype.updateMapCenterZoom = function(center, zoom) {this.updateZoom(zoom);this.updateMapCenter(center);}Nothing amazing but works! You give the center and the zoom and the map changes the focus.Hope it can be helpfull for other people as well.When i finish the theme i'm working on i will post it here!Thank you for the help!Gabriel.On Mon, Oct 7, 2013 at 10:22 PM, Gabriel Machado <gabrielmcf@...> wrote:
See you soon,Thank you for the fast help! That's way i love free software!Hey people, thank you very much for the help!I think that, to begin with, i will just hard code the cities and, when my boss sees that its already working, i will do the plugin and publish it.
I will be working on that this week and you can be sure i will feed you back with whatever comes out!
Gabriel.On Mon, Oct 7, 2013 at 9:39 PM, Robbie MacKay <robbie@...> wrote:
A better way to do it would be build a plugin and use that to render a separate list of cities, you could use the existing cities table to get city lat/lon values, and inject it into the filter list or somewhere similar using Events. Sorry thats a bit vague on details.. but I can try to answer further questions.The quick hacky way to build your cities switching would be to hard code the list of cities and latitude into the frontend view, add .click() handlers to each link to a city, make the click handlers call map.updateMapCenter..Hi Gabriel,The mapping on the frontend is handled by media/js/ushahidi.js .. which wraps a lot of openlayers functionality.
On the main page, you should be able to update the map focus by doing something like this (in js):
map.updateMapCenter({latitude: 0, longitude:0});
I think http://map.occupy.net/ had some similar functionality where you could load urls like: http://map.occupy.net/reports/view_location/133 but I'm not sure how reusable that is. I think it would be quite a job to extract that code.. (repo here: https://github.com/occupynet/occupymap)
Robbie--On Tue, Oct 8, 2013 at 10:01 AM, Gavin Cameron <gavin@...> wrote:
If you get anywhere with this please share. I'd find this valuable functionality too, but I do not have the dev skills.--On Mon, Oct 7, 2013 at 3:46 PM, Romulo Pires <romulo.pires123@...> wrote:
Hello,check panTo function in openlayer documentation.--2013/10/7 Gabriel Machado <gabrielmcf@...>
See you,Thank you very much and congratulations for the project, its just incredible!Do you have any idea how should i proceed? Any suggestions?Im not sure how should i proceed, im trying to do this just changing the theme and some javascript because i'm in a kind of a hurry, but i want to develop a plugin to do this.I've started last week to study the codes from Ushahidi and i'm a little bit lost. Im a programmer but have never worked with web languages!Hi people,I'm trying to make a modification in Ushahidi so that i can list a bunch of cities and, when i click a link, it changes the focus of the map to a given city.
I'm Brazilian and new at Ushahidi!
Gabriel Fonseca.
Romulo Pires Pinto
UFF/IC/BCC
best
Gavin
Crowd-sourced Architectural Salvage | trashswag.com
Too brief? Here's why! http://emailcharter.orgRobbie Mackay