I have made the function below. This doesn't work. Not appears points on map.
I give parameters values to function.
function getinfo_sendquestionzasobyeduall(anypath, webagent, froms, next, select, radius) {
$.ajax({
type: "GET",
url: anypath, //url to file.php
contentType: "application/json; charset=utf-8",
dataType:'json',
success: function(json) {
for (var klucz in json) {
var wiersz = json[klucz];
var zmienna5V1 = wiersz[41];
var zmienna6H1 = wiersz[42];
//alert('latin:'+zmienna5V1+' longin:'+zmienna6H1);
//show me info about geting sucess -is OK //
//next i parametresion function below
addlocationbingmap(zmienna5V1,zmienna6H1);
}
},
error: function(error) {
}
});
}
in the function i wont add points to map but dont work
function addlocationbingmap(geoV1,geoH1)
{
var navigationBarMode = Microsoft.Maps.NavigationBarMode;
var map = new Microsoft.Maps.Map('#oringseriesmap',
{
//where your api key
credentials: 'MY API KEY',
center: mapCentre,
navigationBarMode: navigationBarMode.compact,
supportedMapTypes: [
Microsoft.Maps.MapTypeId.road,
Microsoft.Maps.MapTypeId.aerial,
Microsoft.Maps.MapTypeId.grayscale,
Microsoft.Maps.MapTypeId.canvasLight
]
});
// to value geoV1 and geoH1
var mylocation = new Microsoft.Maps.Location(parseFloat(geoV1), parseFloat(geoH1));
// push pin to map
var pushpin = new Microsoft.Maps.Pushpin(mylocation, { text: '0', title: '1', subTitle: '', color: '#F00'});
map.entities.push(pushpin);
}
In file *.html :
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol' async defer></script>
A couple of things to help you debug this: