0

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.

RareBoy
  • 77
  • 2
  • 13

1 Answers1

0

I am not using any plugin. Basic javascript google maps with API.

I already answered into my first post but the 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.

Sometimes in Visual Studio Rebuild won´t work. Have to do first clean and than build. Maybe that was the problem for the first time. Dunno. But everything works now smoothly!

RareBoy
  • 77
  • 2
  • 13