Map with Marker

6 posts / 0 new
Last post
kdshq
Map with Marker

Hi everyone. 

I have a simple map with a marker. My map is working and showing but the marker is not working. here is my code:

 

window.onload = function() {

L.mapquest.key = "ckcOm";
 

// 'map' refers to a <div> element with the ID map

L.mapquest.map("map", {

center: [51.5168, -0.4368],

// L.mapquest.tileLayer('map') is the MapQuest map tile layer

layers: L.mapquest.tileLayer("map"),

zoom: 13

});
 

L.marker([51.5168, -0.4368], {

icon: L.mapquest.icons.marker({

primaryColor: '#22407F',

secondaryColor: '#3B5998',

shadow: true,

size: 'md',

symbol: 'A'

})

}).addTo(map);

};

 

 


MQBrianCoakley
This icon worked great for me

This icon worked great for me.

 

L.marker([51.5168, -0.4368], {
  icon: L.mapquest.icons.marker({
    primaryColor: '#22407F',
    secondaryColor: '#3B5998',
    shadow: true,
    size: 'md',
    symbol: 'A'
  })
}).addTo(map);

 


kdshq
Thanks but this is my exact

Thanks but this is my exact same code. Any other ideas?


MQBrianCoakley
Can you provide a url where

Can you provide a url where we can see this happening? Or a complete sample page to show the issue?

 

Do you see any errors in the browser console?


kdshq
Thank you for your reply. I

Thank you for your reply. I don't have a url as the project is still under development but i can show you what errors appear in the console. 

Uncaught TypeError: t.addLayer is not a function mapquest.js:10

at e.addTo (mapquest.js:10)

at (window.onload maps.js:1)


MQBrianCoakley
What is the t variable?
What is the t variable?