I am getting error: "Failed to load resource: the server responded with a status of 404 (Not Found)" with icon file in javascript file.
Trying to get a marker to show in google map.
var image = {
url: "green.png",
size: new google.maps.Size(20, 32),
origin: new google.maps.Point(0, 0),
anchor: new google.maps.Point(0, 32)
};
var marker = new google.maps.Marker({
position: { lat: latitude, lng: longitude },
map: map,
icon: image,
title: ""
});
I am using Visual Studio 2015 with Apache Cordova.
Files are located in www/scripts/googlemap.js and www/scripts/green.png.
EDIT: Main problem was source. Url should be /scripts/green.png or scripts/green.png. I thought I tried these before but didn´t to get those working for some reason.