Question about custom marker on mapview

Hello,

I read recently that an update allows a custom image marker for the mapview. So if I add a marker with a custom image in the options then it will place that image as the marker instead of the normal red marker Google uses? Is there a specific size I need to use for the image? I assume it should be a png for transparency.

Thanks,

Warren

Hi Warren,

It looks like you were following the thread about the Corona sample business app, related to this blog post:

http://coronalabs.com/blog/2013/10/09/a-look-inside-a-sample-corona-powered-business-app/

This uses custom map markers, so if you download it, you should be able to inspect the code and get everything you need to implement your own markers.

Hope this helps,

Brent

Thanks, I just installed the app on my phone and saw the unique markers.

One question - is there any way to select a marker or something in the popup from the marker and have the app do something? For example, if I want the user to select a location from the markers can that be done?

Nevermind, I saw there this was added. Its hard to find some topics using the forum search so I used Google’s search and found it. I see an event listener was added to the marker event. But I wish the event was added when you selected something in the popup for the marker. For example, I would like to click the marker for a few details about the place. Then click it to do something. Is that possible?

Thanks,

Warren

Actually since the event is for when the marker is tapped, can I not have the popup show for the marker and make my own popup in the event part? Or will the marker’s popup show anyways even if I leave the title and subtitle blank?

I don’t know about the blank part, but an eventListener is triggered when the marker is tapped (outside of the little popup that goes with it), so you could have other things go on as well.

I just tried it and if I leave the title information blank but even use a custom image as a marker the popup does not show. I guess it will only show if you have the title which makes sense. What I am going to try next is to create my own popup so it shows information and has a button so I can select the location.

Hi Warren,

It looks like you were following the thread about the Corona sample business app, related to this blog post:

http://coronalabs.com/blog/2013/10/09/a-look-inside-a-sample-corona-powered-business-app/

This uses custom map markers, so if you download it, you should be able to inspect the code and get everything you need to implement your own markers.

Hope this helps,

Brent

Thanks, I just installed the app on my phone and saw the unique markers.

One question - is there any way to select a marker or something in the popup from the marker and have the app do something? For example, if I want the user to select a location from the markers can that be done?

Nevermind, I saw there this was added. Its hard to find some topics using the forum search so I used Google’s search and found it. I see an event listener was added to the marker event. But I wish the event was added when you selected something in the popup for the marker. For example, I would like to click the marker for a few details about the place. Then click it to do something. Is that possible?

Thanks,

Warren

Actually since the event is for when the marker is tapped, can I not have the popup show for the marker and make my own popup in the event part? Or will the marker’s popup show anyways even if I leave the title and subtitle blank?

I don’t know about the blank part, but an eventListener is triggered when the marker is tapped (outside of the little popup that goes with it), so you could have other things go on as well.

I just tried it and if I leave the title information blank but even use a custom image as a marker the popup does not show. I guess it will only show if you have the title which makes sense. What I am going to try next is to create my own popup so it shows information and has a button so I can select the location.