-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/02/2012 04:55 PM, John Etherton wrote:
> Yeah the mapping code is a bit of a mess for sure. I totally agree with the lack of hooks in the JS and the fact that you can't overwrite the JS views like you can overwrite the HTML views in the themes.
>
> For the work I've done, I try to find sneaky ways to hijack the existing JS and get it to do what I want. Check out my two mapping plugins. You can see how I did things. If you have specific questions let me know. https://github.com/jetherton/adminmap, https://github.com/jetherton/densitymap.


Ah yeah.  I looked at densitymap and I think that is the way I am going to go, inserting the javascript with the ushahidi_action.header_scripts, it appears that plugins get called after core JS so I can overwrite anything I want in core.

>
> I'd like to see a MVC architecture taken to ushahidi's mapping system. Where the map is just a view, and things like timelines and category filters become controls, all using a standardized API. Makes me smile just thinking about it.


This makes a lot of sense and I have to say I am a bit surprised that the core dev team did not take this approach from the begining since ushahidi is so map and by relationship openlayers centric.  OpenLayers is an amazing library that has a ton of features of which ushahidi core uses a small subset of.  Making it easier for plugin developers to hook into the mapping interface and leverage the power of OpenLayers whiloe maintaining the MVC architecture that the rest of the system would be fantastic.

Thanks!
evoltech

>
>
> John Etherton
> +1-404-578-1606
> john.etherton@... <mailto:john.etherton@...>
>
> On 02/02/2012 05:49 PM, George Chamales wrote:
>> I second your issues with the mapping system. Overwriting the js is the approach that we've used in the past to shoe-horn more useful functionality into the map. John Etherton's rewrite of the mapping functionality for the Admin Map / Big Map plugin is also out there.
>>
>> What sort of things are you looking to add?
>>
>> george
>>
>> George Chamales
>> Rogue Genius LLC
>> http://roguegenius.com
>> Phone: 718.288.7718
>> Skype: notgeorge
>>
>>
>>
>>
>> On Thu, Feb 2, 2012 at 4:28 PM, Mr. Evoltech <evoltech@... <mailto:evoltech@...>> wrote:
>>
>>
> Hello All,
>
> This is my first post to this list. I am the lead developer of the
> March-Hare Communications Collective. We are adding a number of
> features to Ushahidi to make it a bit more suitable for real time report
> aggregation and publishing at the street level for protesters.
>
> Right now alot of the functionality we are working on is in the
> OpenLayers code of Ushahidi. While there are ways to hook into
> different sections of functionality for the site there do not seem to be
> many ways to hook into JS. To make issues more difficult for developers
> who want to customize the mapping features of Ushahidi it seems like
> there is a fair amount of duplication of OpenLayers code in the
> project. I am wondering if anyone can speak if there are any plans to
> address these issues and / or if there is a specific way it is intended
> for developers to hook into the OpenLayers JS for mapping pages?
>
> Currently the technique I am using is not to override the
> /application/views/*_js.php files, but to use the
> ushahidi_filter.header_js event to override javascript functions in the
> end of the JS that is inserted in the html header with code like so:
>
> preg_match(':^(.+)(//-->\s*</script>\s*)$:s', Event::$data, $matches);
> $new_js = " ... ";
> Event::$data = $matches[1] . $new_js . $matches[2];
>
> Sincerely,
> evoltech
>
>
>>
>>
>>
>>
>> ~~~~~~~~~~~~~~~~~~~~~~~~~~
>> List Archive: http://list.ushahidi.com/
>>
>> Would you like to receive list mail batched in a daily digest instead? Send a message to:
>> developers-digest-subscribe@... <mailto:developers-digest-subscribe@...>
>>
>> To remove your address from the list, just send a message to
>> the address in the "List-Unsubscribe" header of any list
>> message. If you haven't changed addresses since subscribing,
>> you can also send a message to:
>> developers-unsubscribe@... <mailto:developers-unsubscribe@...>
>>
>> For addition or removal of addresses, we'll send a confirmation
>> message to that address. When you receive it, simply reply to it
>> to complete the transaction.
>>
>> If you need to get in touch with the human owner of this list,
>> please send a message to:
>> developers-owner@... <mailto:developers-owner@...>
>>
>>


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJPLB9mAAoJEDTy25qNIucjOTgQAKRR06/WMu5hC3kn4ork0ELi
MFhdkqFNf7wc6dXpuDLyRZc0+Im5vMfXs2CtW11LLds7r+vutOSLithV+ztM10In
pQpfYYCS0ek8q89he+AH/wvUzF1LuGYLnwYQQIG1ImW/2KtpgJlo0DB/AMkCYJad
2TcKYg+QHnI7ATclXqMADsAcle08sank35vA1sjvzO19+scHCgIr9r2qSrBBTxFj
oA6QvBQpAOEcMLXilNMR5TP+zedB1jtcxG6aEpFDE/KfO1OZ5s8v0++D/d+VaPTw
mpZkwtJtaD/ctV4NvDj/E4fXRBzmTxPSNcJHLwfWFUEU87YoUrMJdrqB+4bsPIB2
PgdF5mvRg6sZqcpeIFKwdLHL8L5NSFJQrWzKfmRP0xJJzMYqwPna/EmNfGqp0hpO
axuDnljzMQDk1qcsFn8kZAla1kUTmBbA6r8DJJhgmSFtm8YSJTl0nRLprMauJ1ZR
bZ8yiTWGRpd6FU1mMdn7V830Uf3+4pV1/qhHTCWpmdByLVo2/rKyXpPgB9foIC7h
ebaAYS0n/uEQ5b4dTsUkZ4AxVP0nSVqpnm6PW9KiOxcoJQG61tgEVHpNRg6wTYKo
frik3+4mZHZ4k0qi1tsjZoVGIar13OCvDhWiXMoOExBaFT7Dnlu6F8jxTAy8CE3h
1v0iiH2Nj825izjlUQn0
=BSrU
-----END PGP SIGNATURE-----