Project

General

Profile

Actions

Feature #1171

closed

Add icon marker to google map

Added by Gaetano Mendola over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Pieter Libin
Target version:
Start date:
02/24/2012
Due date:
% Done:

0%

Estimated time:

Description

Hi all,

I had the need to add a marker to a google map and I hadded the following method to WGoogleMap:

file WGoogleMap:

@

/*! \brief Adds a icon marker overlay to the map.

*/

void addIconMarker(const Coordinate &pos, const std::string& iconURL);

@

@

file WGoogleMap.C:

void WGoogleMap::addIconMarker(const Coordinate &pos,

const std::string& iconURL)

{

std::stringstream strm;

if (apiVersion_ == Version2) {

throw std::logic_error("WGoogleMap::addIconMarker is not supported "

"in the Google Maps API v2.");

} else {

strm << "var position = new google.maps.LatLng("

<< pos.latitude() << ", " << pos.longitude() << ");"

<< "var marker = new google.maps.Marker({"

<< "position: position,"

<< "icon: \"\" << iconURL << "\",\"

<< "map: " << jsRef() << ".map"

<< "});"

<< jsRef() << ".map.overlays.push(marker);";

}

doGmJavaScript(strm.str());

}

@

Actions #1

Updated by Koen Deforche over 12 years ago

  • Status changed from New to InProgress
  • Assignee set to Pieter Libin
  • Target version set to 3.2.1
Actions #2

Updated by Pieter Libin over 12 years ago

  • Status changed from InProgress to Resolved
Actions #3

Updated by Koen Deforche over 12 years ago

  • Status changed from Resolved to Closed

Fixed in 3.2.1

Actions

Also available in: Atom PDF