0

So basically I am having some problem with OneMap API access key. Here is how I set up my base map:

HTML

<div id="divMain"></div>

JavaScript

<script type='text/JavaScript' src='http://www.onemap.sg/API/JS?accessKEY=xkg8VRu6Ol+gMH+SUamkRIEB7fKzhwMvfMo/2U8UJcFhdvR4yN1GutmUIA3A6r3LDhot215OVVkZvNRzjl28TNUZgYFSswOi'></script>

<script language="JavaScript" type="text/JavaScript">  
var centerPoint="28968.103,33560.969"
var levelNumber=8;
var OneMap = new GetOneMap('divMain','SM',{level:levelNumber,center:centerPoint});  
</script>

Reference from OneMap API Documentation These codes work when the access key token is legal. But somehow, sometimes the access key just turns to illegal for no reason. And sometimes even when I keep refreshing, it does not solve the bug. My URL starts with localhost:2752/...

Any guides? Because this can be considered as significant issue as sometimes when I am trying to debug some new features, the OneMap just stop working.

Thanks in advance.

  • Any guides? I not sure what's wrong with the access key. It works last time but somehow it just stopped working for now. –  Jun 27 '14 at 23:57

1 Answers1

0

The API key works only for one domain. So when you register for API key, you should use the domain you are using on PC for obtaining the API key. Try to use some fake domain as lvh.me:2752, etc.

Ducle
  • 86
  • 1
  • 3