Thank you, Adam. That is exactly the kind of example I needed!


Darcy W. Christ
Digital Generalist
@1000camels

To send me a secure message: http://bit.ly/SecureMsg


> On 17 Feb 2016, at 11:11 AM, Adam Cox <[email protected]> wrote:
> 
> Hi Darcy, I have done all my development on github, so you can see my 
> base-layers.js file here: 
> https://github.com/mradamcox/afrh/blob/master/afrh/media/js/map/base-layers.js
>  
> <https://github.com/mradamcox/afrh/blob/master/afrh/media/js/map/base-layers.js>.
> 
> I'm using the OSM tiles that mapquest serves (check out the OSM Wikipedia 
> page for more endpoints) and some aerial imagery from Washington DC. No Bing 
> layers.
> 
> I added a new property or two (like 'altlayer') which you won't need, but 
> otherwise you could more or less copy straight from there.
> 
> Let me know if you have more questions!
> 
> Adam
> 
> On Feb 16, 2016 8:56 PM, "Darcy Christ" <[email protected] 
> <mailto:[email protected]>> wrote:
> Hi,
> 
> I am certain this is because I don't understand OSM well enough yet. Mostly I 
> am looking for more examples of base-layers.js.
> 
> The default basemap from BingMaps is too basic. For example, it doesn't show 
> the buildings, which I do see on OSM 
> (https://www.openstreetmap.org/export#map=17/22.28293/114.13540 
> <https://www.openstreetmap.org/export#map=17/22.28293/114.13540>). I do not 
> for example, see how to find a url that ends in .png, as the documentation 
> suggests. I have also tried to use mapbox, thinking that might be better. In 
> general, I am confused about whether I need to set up my own tileserver and 
> whether how I go about finding the correct URL to use. This would also extend 
> to adding and remove elements on the map.
> 
> I have tried to add the following to my base-layers.js, but it is not 
> working. I am also running "python manage.py collectstatic" each time, 
> assuming that is needed to make sure my changes compile and get included. 
> 
> Any suggestions would be greatly appreciated.
> 
> base-layers.js:
> 
> define([
>     'jquery',
>     'openlayers',
>     'underscore',
>     'arches'
> ], function($, ol, _, arches) {
>     var baseLayers = arches.bingLayers;
> 
>     _.each(baseLayers, function(layer) {
>         layer.layer = new ol.layer.Tile({
>             visible: false,
>             preload: Infinity,
>             source: new ol.source.BingMaps({
>                 key: arches.bingKey,
>                 imagerySet: layer.id <http://layer.id/>
>             })
>         });
>     });
> 
>     //set default map style to Roads
>     baseLayers[0].layer.setVisible(true);
> 
>     baseLayers.push({
>         id: 'hku-map',
>         name: 'HKU OSM',
>         icon: arches.urls.media + 'img/map/an_example.png',
>         layer: new ol.layer.Tile({
>             visible: false,
>             source: new ol.source.XYZ <http://ol.source.xyz/>({
>                 //url: 
> 'https://www.openstreetmap.org/way/31853930#map=17/22.28291/114.13676 
> <https://www.openstreetmap.org/way/31853930#map=17/22.28291/114.13676>'
>                 url: 
> 'https://api.mapbox.com/styles/v1/1000camels/cikq7mx1l001698m9m2kgicfu.html?title=true&access_token=pk.eyJ1IjoiMTAwMGNhbWVscyIsImEiOiJjaWtuaTAybm4wc25hdHpqNzVsOW44cTFxIn0.L2-D4bbSSLnv64N92vKUyQ#16.375201114760873/22.283472227128584/114.1371841696241/0
>  
> <https://api.mapbox.com/styles/v1/1000camels/cikq7mx1l001698m9m2kgicfu.html?title=true&access_token=pk.eyJ1IjoiMTAwMGNhbWVscyIsImEiOiJjaWtuaTAybm4wc25hdHpqNzVsOW44cTFxIn0.L2-D4bbSSLnv64N92vKUyQ#16.375201114760873/22.283472227128584/114.1371841696241/0>'
>             })
>         })
>     });
> 
>     baseLayers[1].layer.setVisible(true);
> 
>     return baseLayers;
> });
> 
> -- 
> -- To post, send email to [email protected] 
> <mailto:[email protected]>. To unsubscribe, send email to 
> [email protected] 
> <mailto:archesproject%[email protected]>. For more information, 
> visit https://groups.google.com/d/forum/archesproject?hl=en 
> <https://groups.google.com/d/forum/archesproject?hl=en>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Arches Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.
> 
> -- 
> -- To post, send email to [email protected]. To unsubscribe, 
> send email to [email protected]. For more 
> information, visit https://groups.google.com/d/forum/archesproject?hl=en 
> <https://groups.google.com/d/forum/archesproject?hl=en>
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Arches Project" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/archesproject/gK5BYSr_pDk/unsubscribe 
> <https://groups.google.com/d/topic/archesproject/gK5BYSr_pDk/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] 
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
-- To post, send email to [email protected]. To unsubscribe, send 
email to [email protected]. For more information, 
visit https://groups.google.com/d/forum/archesproject?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Arches Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to