Hi there,
You have few mistakes:
- first as said Chris - you have ended CDATA and 'load' function too
early so it should look like code below
- second: you have used different name for marker: marker and
marker162900 - in code below it is corrected to marker162900
after these changes marker is visible. Code below contains all
<script> data so you can just copy and replace your script section and
it should working.
Cheers,
Michal Biniek
<script type="text/javascript">
//<![CDATA[
function load()
{
if (!GBrowserIsCompatible())
return;
var copyOSM = new GCopyrightCollection("<a href=\"http://
www.openstreetmap.org/\">OpenStreetMap</a>");
copyOSM.addCopyright(new GCopyright(1, new GLatLngBounds(new
GLatLng(-90,-180), new GLatLng(90,180)), 0, " "));
var tilesMapnik = new GTileLayer(copyOSM, 1, 17,
{tileUrlTemplate: 'http://tile.openstreetmap.org/{Z}/{X}/{Y}.png'});
var tilesOsmarender = new GTileLayer(copyOSM, 1, 17,
{tileUrlTemplate: 'http://tah.openstreetmap.org/Tiles/tile/{Z}/{X}/
{Y}.png'});
var mapMapnik = new GMapType([tilesMapnik],
G_NORMAL_MAP.getProjection(), "Mapnik");
var mapOsmarender = new GMapType([tilesOsmarender],
G_NORMAL_MAP.getProjection(), "Osmarend");
var map = new GMap2(document.getElementById("map"),
{ mapTypes: [mapMapnik, mapOsmarender] });
map.addControl(new GLargeMapControl3D());
map.addControl(new GOverviewMapControl());
map.addControl(new GMapTypeControl());
map.setCenter( new GLatLng(44.538056, 18.676111), 14);
var iconMole = new GIcon();
iconMole.image = "stan.png";
iconMole.shadow = "shadow.png";
iconMole.iconSize = new GSize(22, 35);
iconMole.shadowSize = new GSize(31, 35);
iconMole.iconAnchor = new GPoint(11, 35);
iconMole.infoWindowAnchor = new GPoint(10, 20);
var naslov = new GLatLng(44.538056, 18.676111);
var marker162900 = new GMarker(naslov,{title:'test'});
map.addOverlay(marker162900);
GEvent.addListener(marker162900, "click", function() {
marker162900.openInfoWindowHtml('test');
});
}
//]]>
</script>
On 19 Gru, 20:27, Nedim <[email protected]> wrote:
> Sorry, what is cdata and how could I move that endpoint?
>
> Thanks
>
> On Dec 19, 6:39 pm, Chris Apolzon <[email protected]> wrote:
>
> > It looks like you are using the v2 google maps api, so you should probably
> > post your question in that mailing list instead.When I loaded your map, I
> > get a map is not defined error on line 48 (map.addOverlay(marker162900);).
> > I'm not sure, but it looks like your cdata section ends just prior to this
> > line, so I would take a look at moving the cdata endpoint to below the end
> > of your script if possible.
>
> > On Sat, Dec 19, 2009 at 11:34 AM, [email protected] wrote:
>
> > Hello.
>
> > I have a problem with markers.
>
> > You can see it here:http://www.bosanskikuhar.ba/maps.html
>
> > It doesn't show anything. Can you please help me?
>
> > Thank you very much.
> > Nedim
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google Maps JavaScript API v3" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected].
> > For more options, visit this group
> > athttp://groups.google.com/group/google-maps-js-api-v3?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.