New map layers (ala haiti.ushahidi.com)


#1

How to add new layers to the map?

via haiti.ushahidi.com - Haiti terrain layer is available below Google's layers.


They have used mapbox.com for this, which is paid service. So,

1. How to add map layers from mapbox.com?

2. How to add map layers from any WMS service?


Almost any mapserver has installed WMS service, which serves its map tiles realtime for free. This way you could easily have maps of


Population density

Polling districts

Flooding areas

Forrest types

etc.


from institutional mapservers in your country. Imagine how this free map data could give new context to displayed information, and even possibly predict the upcoming situation - so help in decision making process.



#2

Is this up on github somewhere?


Brian



#3

I did just notice one issue, all of the reports become clustered into one giant cluster when changing to the Mapbox view.



#4

I'd also be interested in a way to add WMS layers as baselayers or overlays using OpenLayers. KML polygon layers also seem to be a problem to set-up. Any help on additional map layers would be appreciated.


Thanks for all the efforts.


Kevin



#5

Got the same problem here:

- what the proper way to add a WMS - from mapbox or other?

- my KML polygons are not displayed


Hints are welcome!


Thanks,

Edouard



#6

I found that my KML overlay could not be displayed if I set an .htaccess authentication (with AuthType Basic). What would be the way to configure .htaccess to both the login authentication for the frontend and the KML overlay well displayed?


Thanks,

Edouard



#7

For the mapbox layers, in application/views, i can see 2 files where map layers can added:

* map_common_js.php

* main_js.php

How do those files interact?


I tried to add a mapbox layer in line 673 of main_js.php :


Code:

var layerusaid = OpenLayers.Layer.TMS(
"lha-ethiopia-mogadishu", // name for display in LayerSwitcher
[ "http://a.tile.mapbox.com/v2/","http://b.tile.mapbox.com/v2/","http://c.tile.mapbox.com/v2/","http://d.tile.mapbox.com/v2/" ], // service endpoint
{layername: "usaid-horn.lha-ethiopia-mogadishu", transparent: 'true', type: "png"},{isBaseLayer: false} // required properties
);

// Add tall the layers together
map.addLayers([<?php echo map::layers_array(FALSE); ?>, layerusaid]);


but that does not work.. Do I miss something?


Thanks,

Edouard



#8

Maybe you should try to add the 'non base-layer' to the map object this way. You also might want to get the available resolutions for these tiles too from MapBox.


[javascript]

jQuery(function() {

map.addLayers(

[

new OpenLayers.Layer.TMS('lha-ethiopia-mogadishu',

[

"http://a.tile.mapbox.com/v2/",

"http://b.tile.mapbox.com/v2/",

"http://c.tile.mapbox.com/v2/",

"http://d.tile.mapbox.com/v2/"

],

{

layername: 'usaid-horn.lha-ethiopia-mogadishu',

type: 'png',

transparent: 'true',

visibility: false,

isBaseLayer: false

}

)

]

);

});

[/javascript]



#9

it is also very easy to adapt the cloudmade basemap plugin for mapbox.


the only difference (besides the url prefix) is that they count the y tiles from the opposite direction.


dietmar



#10

Hi everyone, so please, any idea if there a code somewhere that would enable easy integration of WMS into Ushahidi? Thanks a lot, Jaro



#11

Hot damn, @dkobia; that's some key code. I sense a plugin in the offing . . .



#12

Anyone had any luck integrating a wms layer into Ushahidi...this would be one of the most important plugins ever I think. It would allow users to really understand the context of the application and offer additional cartographic information for the user.


Any tips..I have tried modifying the cloudmade plugin..but without success.


yours,


Rob



#13

I have modified the cloudmade plugin and almost has success displaying a wms layer. The after modifying the code I could display the wms in the map-settings page, but when I changed to the main website page, there is a problem with coordinate systems I think....which is strange because the wms tiles are being loaded. All the images are white which means they are coming from a bbox area outside the map.


If someone has time to modify my code, I would be please to share what I have done. The modifications are very simple.


I Really want to get this thing going with wms as this would enable geowebcache tiles to be served as well,


Hope someone out there can help,


Rob



#14

HI Robert, I think you resolved this via skype or with Seth Kigen’s plugin.

 

 

Heather