Closed xianlin closed 9 years ago
You can set the pubnub
init parameter when using Eon Maps. This allows you to configure PubNub client connections with extra security options such a auth_key
and your cipher_key
. You should also set secure: true
and ssl: true
as well.
<div id="map"></div>
<script>
var pubnub = PUBNUB({ subscribe_key : 'my_own_key', ssl : true });
var channel = 'my-map';
eon.map({
pubnub : pubnub, // < - - - here < - - - //
channel : channel,
id : 'map',
mb_id : 'mapbox.streets',
mb_token : 'pk.ey31IjoiaWRtc3giLCJhIjoiZZ1zMGI2ZjBlNTMxZjk5YTEwNjM5WNJlOWI4MmJiZGIifQ.U1jMQo2QVeuUtt85oD7hkQ'
});
</script>
I added the docs here: https://github.com/pubnub/eon-map/blob/master/README.md#configure-using-your-own-pubnub-api-keys
Hey @xianlin,
Sorry, the documentation was outdated. The method you (and @stephenlb) describe is correct.
Ian
:+1: 👍:+1: 👍
Thank you guys, finally got it working... will try other services Pubnub offers...
Very nice!
I cannot get it working by using the below script, the requetsed url is still "demo" url
http://ps4.pubnub.com/subscribe/demo/my-map/0/0?uuid=some_long_string&pnsdk=PubNub-JS-Web%2F3.7.8
However if I used the below script, it works
The only differences is I am not using eon-map
eon.map
function.Could someone please show how to use
own pubnub key