0

YOUR API KEY

Hi could you please help with the API key.

I have found severel snippets of code that ask to change the API KEY.

When I run the code first it works fine when I change the code it just hangs up.

I have tried looking for help but keep going around in circles and not getting any answers the first code below works and the second code is where i have added my key and does not work.



CODE
<div id="map"></div>
<script src="http://yui.yahooapis.com/2.7.0/build/utilities/utilities.js"></script>
<script type="text/javascript" src="http://l.yimg.com/d/lib/map/js/api/ymapapi_3_8_2_3.js"></script>
<script type="text/javascript">
var YMAPPID = 'wOe8b_PV34GNdPTKYvDmACUP97wRs.AJ_eiMwiHc6fzysRD3.GM.iwp_2XvgrTKlNjO9C7aKWXop
abQO1Q-- ';
// ^^ REPLACE THIS CODE WITH YOUR OWN!!! ^^
(function(){
function placeonmap(o){
if(o.length > 0){
var geopoints = [];
var map = new YMap(document.getElementById('map'));
map.addZoomLong();
map.addPanControl();
for(var i=0;i<o.length;i++){
var point = new YGeoPoint(o[i].lat,o[i].lon);
geopoints.push(point);
var newMarker = new YMarker(point,o[i].id);
newMarker.addAutoExpand(o[i].title);
map.addOverlay(newMarker);
}
var zac = map.getBestZoomAndCenter(geopoints);
map.drawZoomAndCenter(zac.YGeoPoint,zac.zoomLevel);
}
}
placeonmap([{"lat":"62.8903","lon":"-149.054","title":"Alaska, US"},{"lat":"60.5531","lon":"-151.26","title":"Kenai, AK, US"},{"lat":"60.3374","lon":"-151.276","title":"Kasilof, AK, US"},{"lat":"61.2176","lon":"-149.858","title":"Anchorage, AK, US"},{"lat":"60.0989","lon":"-150.277","title":"Kenai Peninsula Borough, AK, US"},{"lat":"47.6036","lon":"-122.329","title":"Seattle, WA, US"},{"lat":"54.4857","lon":"-126.556","title":"British Columbia, CA"},{"lat":"-35.7052","lon":"-71.3411","title":"Chile"},{"lat":"55.3421","lon":"-131.648","title":"Ketchikan, AK, US"},{"lat":"49.1632","lon":"-123.137","title":"Richmond, British Columbia, CA"},{"lat":"36.1321","lon":"-5.34829","title":"Gibraltar"},{"lat":"14.4994","lon":"-14.4455","title":"Senegal"},{"lat":"35.6998","lon":"139.431","title":"Tokyo Prefecture, JP"},{"lat":"-24.9162","lon":"133.393","title":"Australia"},{"lat":"64.9504","lon":"26.0641","title":"Finland"}]);
})();
</script>


This one does not work

CODE
<div id="map"></div>
<script src="http://yui.yahooapis.com/2.7.0/build/utilities/utilities.js"></script>
<script type="text/javascript" src="http://l.yimg.com/d/lib/map/js/api/ymapapi_3_8_2_3.js"></script>
<script type="text/javascript">
var YMAPPID = 'tl5grLXV34Fp64cOd.020JvvEgkEBowIntiC7OhXLbhE4OW3AUpdaWjcC2mhOzVrnGyUTBtA2aQR
11MQaA-- ';
// ^^ REPLACE THIS CODE WITH YOUR OWN!!! ^^
(function(){
function placeonmap(o){
if(o.length > 0){
var geopoints = [];
var map = new YMap(document.getElementById('map'));
map.addZoomLong();
map.addPanControl();
for(var i=0;i<o.length;i++){
var point = new YGeoPoint(o[i].lat,o[i].lon);
geopoints.push(point);
var newMarker = new YMarker(point,o[i].id);
newMarker.addAutoExpand(o[i].title);
map.addOverlay(newMarker);
}
var zac = map.getBestZoomAndCenter(geopoints);
map.drawZoomAndCenter(zac.YGeoPoint,zac.zoomLevel);
}
}
placeonmap([{"lat":"62.8903","lon":"-149.054","title":"Alaska, US"},{"lat":"60.5531","lon":"-151.26","title":"Kenai, AK, US"},{"lat":"60.3374","lon":"-151.276","title":"Kasilof, AK, US"},{"lat":"61.2176","lon":"-149.858","title":"Anchorage, AK, US"},{"lat":"60.0989","lon":"-150.277","title":"Kenai Peninsula Borough, AK, US"},{"lat":"47.6036","lon":"-122.329","title":"Seattle, WA, US"},{"lat":"54.4857","lon":"-126.556","title":"British Columbia, CA"},{"lat":"-35.7052","lon":"-71.3411","title":"Chile"},{"lat":"55.3421","lon":"-131.648","title":"Ketchikan, AK, US"},{"lat":"49.1632","lon":"-123.137","title":"Richmond, British Columbia, CA"},{"lat":"36.1321","lon":"-5.34829","title":"Gibraltar"},{"lat":"14.4994","lon":"-14.4455","title":"Senegal"},{"lat":"35.6998","lon":"139.431","title":"Tokyo Prefecture, JP"},{"lat":"-24.9162","lon":"133.393","title":"Australia"},{"lat":"64.9504","lon":"26.0641","title":"Finland"}]);
})();
</script>


Thank you in antisipation

World Fishing News
Billy

0 Replies
This forum is locked.

Recent Posts

in Placemaker General Discussion