Project

General

Profile

Actions

Feature #1171

closed
GM PL

Add icon marker to google map

Feature #1171: Add icon marker to google map

Added by Gaetano Mendola over 14 years ago. Updated over 14 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());
}
@

KD Updated by Koen Deforche over 14 years ago Actions #1

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

PL Updated by Pieter Libin over 14 years ago Actions #2

  • Status changed from InProgress to Resolved

KD Updated by Koen Deforche over 14 years ago Actions #3

  • Status changed from Resolved to Closed

Fixed in 3.2.1

Actions

Also available in: PDF Atom