Google Maps extension basic questions

0
0

First, I red other posts regarding Google Maps. So tell me I’m stupid, not lazy 🙂

I was working with GMap.Winforms, so I’m confused about some basic tasks here (map is my map control, and I’m using C#):

  1. I am able to add markers on map, with map.AddMarker(m.id, m.lat, m.lon, null); But I’m not able to specify tooltip, the icon used (from existing ones, or custom maybe). The instruction map.AddMarker(m.id, m.lat, m.lon, “{label=\”boo\”;}”); is just ignored.
  2. How can I display some detailed info on marker click?

Please reply with some code to display a marker “small green”, with label/tooltip “boo”.

Thank you.

  • You must to post comments
0
0

Hi Adrian

Please, could you post a small running sample ? to check what is not working at your side

Regards

  • Adrian Zagar
    take the line (that line is working) : map.AddMarker(m.id, m.lat, m.lon, (Wisej.Core.DynamicObject)(Wisej.Core.WisejSerializer.Parse(“{title:\”” + m.tooltip + “\”,icon:\”http://www.googlemapsmarkers.com/v1/” + m.color + “\”}”))); Please add or modify it in order to use scaledSize to scale width and height to 50%
  • You must to post comments
0
0

Ok, I discovered some parts. That code is working:

map.AddMarker(m.id, m.lat, m.lon, (Wisej.Core.DynamicObject)(Wisej.Core.WisejSerializer.Parse(“{title:\”” + m.tooltip + “\”,icon:\”http://www.googlemapsmarkers.com/v1/” + m.color + “\”}”)));

 

How can I use scaledSize to reduce marker size? I found that for Java, but I don’t know how to user it in C# – Wisej:

var icon = {
     url: "../res/sit_marron.png", // url
     scaledSize: new google.maps.Size(width, height), // size
     origin: new google.maps.Point(0,0), // origin
     anchor: new google.maps.Point(anchor_left, anchor_top) // anchor 
 };

 position = new google.maps.LatLng(latitud,longitud)
 marker = new google.maps.Marker({
  position: position,
  map: map,
  icon: icon
 });
  • Adrian Zagar
    …and what is syntax to use my own (local)icons from resources?
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.