I load the js successfully with:
<script src="<?php bloginfo('template_url'); ?>/js/google-map.js" type="text/javascript"></script>
I then have:
var apartments = new google.maps.MarkerImage('/images/apartment-3.png',
new google.maps.Size(129, 42),
new google.maps.Point(0,0),
new google.maps.Point(18, 42)
);
.. and load the apartments var for each POI I show on my Google map.
The paths are /js/google-map.js and /images/apartment-3.png
The js code for Google map display is correct because if I use the js code in the header with
var apartments = new google.maps.MarkerImage('<?php bloginfo('template_url'); ?>/images/apartment-3.png'
,
for the image URL, it works. If I get the js in the external js file, my icon won't load anymore, even if I use /images/apartment-3.png or images/apartment-3.png for the URL of the new icon, which is normal as my header is on the root of this WP theme.
What am I doing wrong? It's a WordPress platform.