- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我是维护一个相当大的内部 Delphi 应用程序的团队的成员。现在我们开始关注 map 支持。我们认为,与某些 map 组件相比,Googlemap 似乎是性价比最高的。当前的解决方案(非常糟糕)的工作原理是从 ShellExecute 启动 Internet Explorer,在 Googlemap URL 中加载一些坐标。然后谷歌地图会显示通过坐标的最佳行驶方向。
它可以工作,但如果坐标数量高于 10,它可能会很慢。除此之外,IE 中似乎存在大的内存泄漏...
另一个选择是使用 TWebBrowser 组件并加载 Googlemap html 文件来显示相同的内容。是的,我了解 Googlemaps 许可政策,并且我们准备在实际使用该解决方案时向 Google 支付费用。
现在我已经为我自己的网站注册了一个 API key ,仅供测试之用。我还发现它可以加载本地 html 文件。根据 Googlemap 文档,我可以从 Javascript 调用 GUnload 来消除 memleaks。由于 API key 绑定(bind)到域或本地文件,我想我必须保存带有坐标的 javascript 文件,然后在每次调用 map 时将其加载到 TWebBrowser 中。我发现这很笨拙,但我看不到其他方法......?
还有其他选项可以使用 Google map 吗?由于性能和内存管理不佳,我不知道除 TWebBrowser 之外的 Delphi 的其他 html 组件。我想使用 Mozilla 组件,但它似乎仅适用于 C++。
对此有何评论和建议?
最佳答案
我不久前已经封装了 Google Maps API。它是一个包含 TWebBrowser 的组件,该组件加载包含一些 javascript 帮助函数的本地 html 文件并设置基本的 Google map 页面。 HTML 文件作为资源嵌入到 exe 中,以便于部署。
它还需要一些工作,但它已经为我做了一些很好的工作。它扩展了此处提出的想法: http://www.stevetrefethen.com/blog/UsingGoogleMapsFromVCLSampleApplication.aspx
我已将演示可执行文件和源代码放在网上: http://www.xs4all.nl/~niff/GoogleMaps.zip
在此屏幕截图中,我已切换到 Google 地球 View :
以下是一些如何使用它的示例:
将 map 以荷兰的某个屎坑为中心,并带有漂亮的圆形坐标:
GoogleMaps1.SetCenter(52,5,True);
加载 KML 或 KMZ 文件:
GeoXML := TGGeoXML.Create('http://mywebsite.com/mykml.kmz');
GeoXML.GoogleMaps := GoogleMaps1;
GoogleMaps1.AddOverlay( GeoXML );
切换到 Google 地球的嵌入式版本,以实现快速、流畅的 3D 操作:
GoogleMaps1.MapType := MT_SATELLITE_3D;
保留叠加层列表,并通过 Delphi 结构对其进行管理:
GoogleMaps1.Overlays[2].hide; // hide overlay 2
GoogleMaps1.RemoveOverlayByIndex(3); // delete overlay 3
它允许您使用快速 Delphi 数组创建多边形,然后在 GMap 中绘制它;
MyPolygon := TGPolygon.Create(MyPointArray);
MyPolygon.Color := clBlue;
MyPolygon.Name := 'Awesome Polygon 1';
GoogleMaps1.AddPolygon( MyPolygon );
它并不打算包装完整的 API;这只是为了让使用谷歌地图时的生活更轻松。DouglasPeuckers 单位并不是真正需要的。当资源耗尽时,它用于简化多边形。
祝你好运,如果你用它创建了一些有用的东西,请告诉我。
{—————————————————————————————————————————————————————————————————————————}
{ Project : uGoogleMaps.pas }
{ Comment : Google Maps API wrapper }
{ }
{ Date : 14 mrt 2008 }
{ Author : Wouter van Nifterick }
{—————————————————————————————————————————————————————————————————————————}
{ The aim of this unit is to wrap the Google Maps API in such a way that }
{ users don't need to know that map operations end up being rendered by }
{ a browser component and JavaScript. }
{ }
{ JavaScript classes have a Delphi counterpart, and each Delphi class }
{ takes care of proper JavaScript rendering and execution. }
{ }
{ For many things, like constructing detailed polygons, this provides a }
{ major performance boost and adds compile-time type checking. }
{ }
{ A big limitation so far is that I didn't find a way to directly pass }
{ complex types from and to the JavaScript engine in IE via COM, so for }
{ now, everything needs to be (de)serialized to and from strings. :( }
{—————————————————————————————————————————————————————————————————————————}
{ Last modified }
{ Date : }
{ Author : }
{—————————————————————————————————————————————————————————————————————————}
{$M+}
unit uGoogleMaps;
interface
uses
Controls,
Dialogs,
ActiveX,
StdCtrls,
ExtCtrls,
SysUtils,
Classes,
Contnrs,
Forms,
SHDocVw,
MSHTML,
StrUtils,
DouglasPeuckers
// , uGoogleEarth_intf
;
const
GoogleMapsFileName = 'GoogleMaps.html';
WGS84_MULT_FACT = 100000; // multiply lat/lon values by this value in order to fit them into integers
DEFAULT_SIMPLIFY_TOLERANCE = 0.5;
{$R GoogleMaps_html.res}
type
TGoogleMapControl = (MC_NONE=1,MC_SMALL,MC_LARGE);
TGoogleMapType = (MT_NORMAL=1,MT_SATELLITE,MT_HYBRID,MT_PHYSICAL,MT_SATELLITE_3D);
TGoogleMaps = class; // forward declaration
GIcon = class end; // to be implemented
IJsClassWrapper=interface(IInterface)
function JsClassName:String;
function GetJsVarName:String;
procedure SetJsVarName(const aVarName:String);
property JsVarName:String read GetJsVarName write SetJsVarName;
function ToJavaScript:String;
end;
IHidable=interface(IInterface)
procedure hide; // Hides the object if the overlay is both currently visible and the overlay's supportsHide() method returns true. Note that this method will trigger the respective visibilitychanged event for each child overlay that fires that event (e.g. GMarker.visibilitychanged, GGroundOverlay.visibilitychanged, etc.). If no overlays are currently visible that return supportsHide() as true, this method has no effect. (Since 2.87)
function isHidden : Boolean; // Returns true if the GGeoXml object is currently hidden, as changed by the GGeoXml.hide() method. Otherwise returns false. (Since 2.87)
procedure show; // Shows the child overlays created by the GGeoXml object, if they are currently hidden. Note that this method will trigger the respective visibilitychanged event for each child overlay that fires that event (e.g. GMarker.visibilitychanged, GGroundOverlay.visibilitychanged). (Since 2.87)
function supportsHide : Boolean; //
end;
// marker class
GMarkerOptions=record
icon : GIcon; // Chooses the Icon for this class. If not specified, G_DEFAULT_ICON is used. (Since 2.50)
dragCrossMove : Boolean; // When dragging markers normally, the marker floats up and away from the cursor. Setting this value to true keeps the marker underneath the cursor, and moves the cross downwards instead. The default value for this option is false. (Since 2.63)
title : String; // This string will appear as tooltip on the marker, i.e. it will work just as the title attribute on HTML elements. (Since 2.50)
clickable : Boolean; // Toggles whether or not the marker is clickable. Markers that are not clickable or draggable are inert, consume less resources and do not respond to any events. The default value for this option is true, i.e. if the option is not specified, the marker will be clickable. (Since 2.50)
draggable : Boolean; // Toggles whether or not the marker will be draggable by users. Markers set up to be dragged require more resources to set up than markers that are clickable. Any marker that is draggable is also clickable, bouncy and auto-pan enabled by default. The default value for this option is false. (Since 2.61)
bouncy : Boolean; // Toggles whether or not the marker should bounce up and down after it finishes dragging. The default value for this option is false. (Since 2.61)
bounceGravity : Integer; // When finishing dragging, this number is used to define the acceleration rate of the marker during the bounce down to earth. The default value for this option is 1. (Since 2.61)
autoPan : Boolean; // Auto-pan the map as you drag the marker near the edge. If the marker is draggable the default value for this option is true. (Since 2.87)
// to implement:
// zIndexProcess : Function; // This function is used for changing the z-Index order of the markers when they are overlaid on the map and is also called when their infowindow is opened. The default order is that the more southerly markers are placed higher than more northerly markers. This function is passed in the GMarker object and returns a number indicating the new z-index. (Since 2.98)
end;
TGPoint=class
end;
TGLatLng=class(TInterfacedObject,IJsClassWrapper)
private
FLat,
FLng:Double;
FJsVarName: String;
function GetJsVarName: String;
procedure SetJsVarName(const Value: String);
published
constructor Create(aLat,aLng:Double);
property Lat:Double read FLat write FLat;
property Lng:Double read FLng write FLng;
function ToJavaScript:String;
function Equals(const AGLatLng:TGLatLng):Boolean;
function ToString:String;
function JsClassName:String;virtual;
property JsVarName:String read GetJsVarName write SetJsVarName;
end;
TGBounds=class(TInterfacedObject,IJsClassWrapper)
private
FJsVarName: String;
FMinX, FMinY, FMaxX, FMaxY:Double;
FMin,FMax,FMid:TGLatLng;
function GetMax: TGLatLng;
function GetMid: TGLatLng;
function GetMin: TGLatLng;
procedure SetJsVarName(const Value: String);
function GetJsVarName: String;
published
destructor Destroy;override;
property minX : Double read FMinX write FMinX;
property minY : Double read FMinY write FMinY;
property maxX : Double read FMaxX write FMaxX;
property maxY : Double read FMaxY write FMaxY;
function ToString:String;
function Equals(aGBounds:TGBounds):Boolean;
property Min:TGLatLng read GetMin;
property Mid:TGLatLng read GetMid;
property Max:TGLatLng read GetMax;
function JsClassName:String;virtual;
property JsVarName:String read GetJsVarName write SetJsVarName;
function ToJavaScript:String;
end;
TGLatLngBounds=class
private
procedure setNorthEast(const Value: TGLatLng);
procedure setSouthWest(const Value: TGLatLng);
published
constructor Create(sw,ne:TGLatLng);
destructor Destroy;override;
function contains(aLatLng:TGLatLng):Boolean; deprecated; // Returns true iff the geographical coordinates of the point lie within this rectangle. (Deprecated since 2.88)
function containsLatLng(aLatLng:TGLatLng):Boolean; // Returns true iff the geographical coordinates of the point lie within this rectangle. (Since 2.88)
function intersects(aGLatLngBounds:TGLatLngBounds):Boolean;
function containsBounds(aGLatLngBounds:TGLatLngBounds):Boolean;
procedure extend(aLatLng:TGLatLng); // Enlarges this rectangle such that it contains the given point. In longitude direction, it is enlarged in the smaller of the two possible ways. If both are equal, it is enlarged at the eastern boundary.
function toSpan() : TGLatLng; // Returns a GLatLng whose coordinates represent the size of this rectangle.
function isFullLat() : Boolean ; // Returns true if this rectangle extends from the south pole to the north pole.
function isFullLng() : Boolean ; // Returns true if this rectangle extends fully around the earth in the longitude direction.
function isEmpty() : Boolean ; // Returns true if this rectangle is empty.
function getCenter() : TGLatLng; // Returns the point at the center of the rectangle. (Since 2.52)
function getSouthWest() : TGLatLng; // Returns the point at the south-west corner of the rectangle.
function getNorthEast() : TGLatLng; // Returns the point at the north-east corner of the rectangle.
property SouthWest : TGLatLng read getSouthWest write setSouthWest;
property NorthEast : TGLatLng read getNorthEast write setNorthEast;
function ToString:String;
function Equals(aGLatLngBounds:TGLatLngBounds):Boolean;
end;
TColor = integer;
// abstract class.. subclassed by TGMarker and TGPolygon and TGPolyLine..
TGOverlay=class(TInterfacedObject,IJsClassWrapper,IHidable)
private
FID: Integer;
FGoogleMaps: TGoogleMaps;
FName: String;
FJsVarName:String;
procedure SetID(const Value: Integer);
procedure SetGoogleMaps(const Value: TGoogleMaps);
procedure SetName(const Value: String);
function GetJsVarName: String;
procedure SetJsVarName(const Value: String);
public
procedure hide;virtual;
function isHidden: Boolean;virtual;
procedure show;virtual;
function supportsHide: Boolean;virtual;
published
property ID:Integer read FID write SetID;
function ToJavaScript:String;virtual;abstract;
property JsVarName:String read GetJsVarName write SetJsVarName;
property GoogleMaps:TGoogleMaps read FGoogleMaps write SetGoogleMaps;
property Name:String read FName write SetName;
function JsClassName:string;virtual;
end;
TOverlayList=class(TObjectList)
private
AutoIncrementID:Integer;
function GetItems(Index: Integer): TGOverlay;
procedure SetItems(Index: Integer; const Value: TGOverlay);
public
property Items[Index:Integer]:TGOverlay read GetItems write SetItems; default;
published
constructor Create;
destructor Destroy;override;
function Add(aGOverlay:TGOverlay):Integer;
procedure Clear;override;
function ToString:String;
end;
TGInfoWindow=class(TGOverlay,IJsClassWrapper,IHidable)
procedure Maximize;
procedure Restore;
private
FHTML: String;
procedure SetHTML(const Value: String);
public
property HTML:String read FHTML write SetHTML;
function JsClassName:String;override;
constructor Create(const aCenter:TGLatLng);
destructor Destroy;override;
function ToJavaScript:String;override;
function supportsHide: Boolean;override;
end;
// used to show a location on a map
// can be dragged, can show a popup, can have custom colors and icon
TGMarker=class(TGOverlay,IJsClassWrapper,IHidable)
private
FCenter: TGLatLng;
FDraggingEnabled: Boolean;
procedure setLatLng(const Value: TGLatLng);
procedure SetDraggingEnabled(const Value: Boolean);
public
function supportsHide: Boolean;override;
published
function JsClassName:String;override;
constructor Create(const aCenter:TGLatLng);
destructor Destroy;override;
property Center:TGLatLng read FCenter write setLatLng;
property DraggingEnabled:Boolean read FDraggingEnabled write SetDraggingEnabled;
function ToJavaScript:String;override;
{ TODO 3 -oWouter : implement all marker methods and events }
procedure openInfoWindow(aContent:String); // Opens the map info window over the icon of the marker. The content of the info window is given as a DOM node. Only option GInfoWindowOptions.maxWidth is applicable.
procedure openInfoWindowHtml(aContent:String); // Opens the map info window over the icon of the marker. The content of the info window is given as a string that contains HTML text. Only option GInfoWindowOptions.maxWidth is applicable.
{ procedure openInfoWindowTabs(tabs, opts?) : none; // Opens the tabbed map info window over the icon of the marker. The content of the info window is given as an array of tabs that contain the tab content as DOM nodes. Only options GInfoWindowOptions.maxWidth and InfoWindowOptions.selectedTab are applicable.
procedure openInfoWindowTabsHtml(tabs, opts?) : none; // Opens the tabbed map info window over the icon of the marker. The content of the info window is given as an array of tabs that contain the tab content as Strings that contain HTML text. Only options InfoWindowOptions.maxWidth and InfoWindowOptions.selectedTab are applicable.
procedure bindInfoWindow(content, opts?) : none; // Binds the given DOM node to this marker. The content within this node will be automatically displayed in the info window when the marker is clicked. Pass content as null to unbind. (Since 2.85)
procedure bindInfoWindowHtml(content, opts?) : none; // Binds the given HTML to this marker. The HTML content will be automatically displayed in the info window when the marker is clicked. Pass content as null to unbind. (Since 2.85)
procedure bindInfoWindowTabs(tabs, opts?) : none; // Binds the given GInfoWindowTabs (provided as DOM nodes) to this marker. The content within these tabs' nodes will be automatically displayed in the info window when the marker is clicked. Pass tabs as null to unbind. (Since 2.85)
procedure bindInfoWindowTabsHtml(tabs, opts?) : none; // Binds the given GInfoWindowTabs (provided as strings of HTML) to this marker. The HTML content within these tabs will be automatically displayed in the info window when the marker is clicked. Pass tabs as null to unbind. (Since 2.85)
procedure closeInfoWindow() : none; // Closes the info window only if it belongs to this marker. (Since 2.85)
procedure showMapBlowup(opts?) : none; // Opens the map info window over the icon of the marker. The content of the info window is a closeup map around the marker position. Only options InfoWindowOptions.zoomLevel and InfoWindowOptions.mapType are applicable.
procedure getIcon() : GIcon; // Returns the icon of this marker, as set by the constructor.
procedure getTitle() : String; // Returns the title of this marker, as set by the constructor via the GMarkerOptions.title property. Returns undefined if no title is passed in. (Since 2.85)
procedure getPoint() : GLatLng; // Returns the geographical coordinates at which this marker is anchored, as set by the constructor or by setPoint(). (Deprecated since 2.88)
procedure getLatLng() : GLatLng; // Returns the geographical coordinates at which this marker is anchored, as set by the constructor or by setLatLng(). (Since 2.88)
procedure setPoint(latlng) : none; // Sets the geographical coordinates of the point at which this marker is anchored. (Deprecated since 2.88)
procedure setLatLng(latlng) : none; // Sets the geographical coordinates of the point at which this marker is anchored. (Since 2.88)
procedure enableDragging() : none; // Enables the marker to be dragged and dropped around the map. To function, the marker must have been initialized with GMarkerOptions.draggable = true.
procedure disableDragging() : none; // Disables the marker from being dragged and dropped around the map.
procedure draggable() : Boolean; // Returns true if the marker has been initialized via the constructor using GMarkerOptions.draggable = true. Otherwise, returns false.
procedure draggingEnabled() : Boolean; // Returns true if the marker is currently enabled for the user to drag on the map.
procedure setImage(url) : none; // Requests the image specified by the url to be set as the foreground image for this marker. Note that neither the print image nor the shadow image are adjusted. Therefore this method is primarily intended to implement highlighting or dimming effects, rather than drastic changes in marker's appearances. (Since 2.75)
}
end;
TGGeoXml=class(TGOverlay,IJsClassWrapper,IHidable)
private
FUrlOfXml: String;
procedure SetUrlOfXml(const Value: String);
published
// function getTileLayerOverlay: GTileLayerOverlay; // GGeoXml objects may create a tile overlay for optimization purposes in certain cases. This method returns this tile layer overlay (if available). Note that the tile overlay may be null if not needed, or if the GGeoXml file has not yet finished loading. (Since 2.84)
// function getDefaultCenter : GLatLng; // Returns the center of the default viewport as a lat/lng. This function should only be called after the file has been loaded. (Since 2.84)
// function getDefaultSpan : GLatLng; // Returns the span of the default viewport as a lat/lng. This function should only be called after the file has been loaded. (Since 2.84)
// function getDefaultBounds : GLatLngBounds; // Returns the bounding box of the default viewport. This function should only be called after the file has been loaded. (Since 2.84)
procedure gotoDefaultViewport(Map:TGoogleMaps); // Sets the map's viewport to the default viewport of the XML file. (Since 2.84)
// function hasLoaded : Boolean; // Checks to see if the XML file has finished loading, in which case it returns true. If the XML file has not finished loading, this method returns false. (Since 2.84)
// function loadedCorrectly : Boolean; // Checks to see if the XML file has loaded correctly, in which case it returns true. If the XML file has not loaded correctly, this method returns false. If the XML file has not finished loading, this method's return value is undefined. (Since 2.84)
function supportsHide : Boolean; override; // Always returns true. (Since 2.87)
function JsClassName:String;override;
constructor Create(const aUrlOfXml:String);
destructor Destroy;override;
property UrlOfXml:String read FUrlOfXml write SetUrlOfXml;
function ToJavaScript:String;override;
end;
// polygon class
TGPolygon=class(TGOverlay,IJsClassWrapper,IHidable)
private
FCoordinates:Array of TGLatLng;
FOpacity: double;
FWeightPx: integer;
FColor: TColor;
FSimplified: TGPolygon;
FIsDirty: Boolean;
procedure SetColor(const Value: TColor);
procedure SetOpacity(const Value: double);
procedure SetWeightPx(const Value: integer);
function GetCount: Integer;
procedure SetSimplified(const Value: TGPolygon);
function GetSimplified: TGPolygon;
public
constructor Create(const aCoordinates: array of TGLatLng);overload;
constructor Create(const aPoints:Array of TPointFloat2D);overload;
function supportsHide: Boolean;override;
published
function JsClassName:String;override;
procedure Clear;
function ToJavaScript:String;override;
function AddPoint(const aGLatLng:TGLatLng):integer;
property Color:TColor read FColor write SetColor;
property WeightPx:integer read FWeightPx write SetWeightPx;
property Opacity:double read FOpacity write SetOpacity;// number between 0 and 1
property Count:Integer read GetCount;
destructor Destroy;override;
property IsDirty:Boolean read FIsDirty write FIsDirty;
property Simplified:TGPolygon read GetSimplified write SetSimplified;
function getSimplifiedVersion(Tolerance:Double=DEFAULT_SIMPLIFY_TOLERANCE):TGPolygon;
class function PolyTypeStr: String;virtual;
end;
TGPolyLine=class(TGPolygon,IJsClassWrapper,IHidable)
published
class function PolyTypeStr:String;override;
function JsClassName:String;override;
end;
TGCopyright=class(TGOverlay,IJsClassWrapper,IHidable)
private
FminZoom: Integer;
Fid: Integer;
Fbounds: TGLatLngBounds;
Ftext: String;
procedure Setbounds(const Value: TGLatLngBounds);
procedure Setid(const Value: Integer);
procedure SetminZoom(const Value: Integer);
procedure Settext(const Value: String);
published
property id : Integer read Fid write Setid; // A unique identifier for this copyright information.
property minZoom : Integer read FminZoom write SetminZoom; // The lowest zoom level at which this information applies.
property bounds : TGLatLngBounds read Fbounds write Setbounds; // The region to which this information applies.
property text : String read Ftext write Settext; // The text of the copyright message.
constructor Create (aId : Integer; aBounds:TGLatLngBounds;aMinZoom:Integer;aText:String);
end;
TGoogleMaps=class(TPanel)
private
FWebBrowser:TWebBrowser;
FhasEnd: Boolean;
FhasStart: Boolean;
FLogLines: TStrings;
FOverlays: TOverlayList;
FMapType: TGoogleMapType;
FLatLngCenter: TGLatLng;
FEnableDoubleClickZoom: Boolean;
FEnableContinuousZoom: Boolean;
FStatusPanel: TPanel;
FJsVarName: String;
procedure LoadHTML(URL:String);
procedure SetLogLines(const Value: TStrings);
procedure SetOverlays(const Value: TOverlayList);
procedure Init;
procedure SaveGoogleMapsHtml(const aFileName:String);
procedure SetLatLngCenter(const Value: TGLatLng);
procedure SetEnableContinuousZoom(const Value: Boolean);
procedure SetEnableDoubleClickZoom(const Value: Boolean);
function GetLatLngCenter: TGLatLng;
property WebBrowser : TWebBrowser read FWebBrowser write FWebBrowser;
procedure SetMapType(AMapType:TGoogleMapType);
procedure SaveHTML(const FileName:String);
function GetHTML: String;
property hasStart : Boolean read FhasStart write FhasStart;
property hasEnd : Boolean read FhasEnd write FhasEnd;
procedure SetStatusPanel(const Value: TPanel);
procedure SetJsVarName(const Value: String);
property DragKind;
property DragMode;
property DockSite;
property Ctl3D;
property BiDiMode;
property AutoSize;
property HelpContext;
property HelpKeyword;
property HelpType;
property Owner;
property ParentBackground;
property ParentBiDiMode;
property ParentCtl3D;
property Showing;
property UseDockManager;
property VerticalAlignment;
property WheelAccumulator;
public
constructor Create(AOwner: TComponent);override;
destructor Destroy;override;
procedure SetCenter(Lat,Lng,Alt:Double;doPan:Boolean=false);overload;
procedure SetCenter(Lat,Lng:Double;doPan:Boolean=false);overload;
procedure SetCenter(LatLng:TGLatLng;doPan:Boolean=false);overload;
procedure HandleOnResize(Sender:TObject);
function GetJsValue(aJavaScript:String):OleVariant;
property HTML: String read GetHTML;
procedure CheckResize;
published
property StatusPanel : TPanel read FStatusPanel write SetStatusPanel;
property LogLines : TStrings read FLogLines write SetLogLines;
property Overlays : TOverlayList read FOverlays write SetOverlays;
property LatLngCenter : TGLatLng read GetLatLngCenter write SetLatLngCenter;
property EnableContinuousZoom:Boolean read FEnableContinuousZoom write SetEnableContinuousZoom default true;
property EnableDoubleClickZoom:Boolean read FEnableDoubleClickZoom write SetEnableDoubleClickZoom default true;
property MapType:TGoogleMapType read FMapType write SetMapType;
property JsVarName:String read FJsVarName write SetJsVarName;
procedure AddControl(ControlType:TGoogleMapControl);
procedure AddStartMarker;
procedure AddEndMarker;
procedure AddMarker(Lat,Lon:Double);
procedure AddPolygon(GPolygon:TGPolygon);
procedure AddOverlay(aOverlay:TGOverlay);
procedure RemoveOverlay(aOverlay:TGOverlay);
procedure RemoveOverlayByIndex(Index:Integer);
procedure ClearOverlays;
procedure SwapBeginEndMarkers;
procedure GetDirections;
procedure ShowAddress(const Street,City,State,Country:String);
procedure openInfoWindow(aLatlng : TGLatLng; aHTML:String);
procedure closeInfoWindow;
procedure ExecJavaScript(const aScript:String);
procedure WebBrowserDocumentComplete(ASender: TObject; const pDisp: IDispatch; var URL: OleVariant);
procedure OnMouseOver;
property Align;
property OnClick;
property OnCanResize;
property OnResize;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnDblClick;
property OnMouseWheel;
property OnMouseWheelDown;
property OnMouseWheelUp;
property OnConstrainedResize;
关于delphi - 从我的 Delphi 应用程序使用 Googlemap?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/558686/
我正在尝试将 Google map 集成到我的 xcode 项目中。我严格按照说明here .不幸的是我得到一个错误: error: 'GoogleMaps/GoogleMaps.h' file no
对不起,我是 iOS 开发新手。我使用来自 here 的库在谷歌地图中获取两个地方的方向。我曾经使用过谷歌地图。导入 Google Maps Framework 后,仍然出现错误... 问题是: 如何
我的应用程序有问题。 当我尝试在 上构建它时Android Studio 一切正常,但是当我尝试在 上构建它时Xcode 我遇到错误并且构建失败。 原因似乎来自AirMaps: 词法或预处理器问题'G
昨天我收到一封来自谷歌的电子邮件,说我可以访问 ios 的 map api,我从应用程序控制台生成了我的 key ,然后我按照 https://developers.google.com/maps/d
我想使用谷歌地图显示一些标记。信息(坐标)存储在本地 *.csv 文件中(我想使用“资源文件”)。 如何读取这个 *.csv 文件?如果我使用“jQuery.get('myFile.csv', fun
我正在尝试找出为什么谷歌地图在一天后的表现与一天前有所不同。 我最近将客户的网站上线。地理定位出现错误,我已修复它。但没有在测试站点上修复它。 今天,在两侧(固定一侧和测试一侧)我的地理位置开始显示非
我正在尝试使用地理编码来获取地址,计算出经度和纬度,然后在 map 上显示叠加层。 我正在使用下面的代码,但是日志条目 Log.e("Found",""+lat);永远不会触发,我不知道为什么。有人可
我尝试了大约 4 个小时,但没有发生。尝试开发一个应用程序来显示谷歌地图中的特定位置。 执行以下代码: GooglemapsActivity.java package com.example.gps2
我在尝试显示 googlemaps 时遇到错误 如果我加载 googlemaps javascript 源 我在 Firebug 中得到这个错误 syntax error [Break on this
我正在尝试在 swift 上创建一个 View Controller 来显示用户所在的位置。我已经实现了谷歌地图,所以现在我所要做的就是插入正确的代码。这样做时,我不断收到这两条错误消息,然后应用程序
我正在构建一个出租车应用程序,我设法将所有带有出租车标记图标的汽车添加到它们的确切位置。 但不知为何,所有的图标都看错了方向, 这是我想要实现的目标: 但我得到: 我的代码: 在这里,我只是将我从服务
问题是我向我的应用程序添加了 GoogleMap Activity ,我什至获得了 key ,但 map 只显示在模拟器中。当我在不同的设备上下载我的应用程序时, map 无法使用。我所能看到的只是一
我有两个动画要按顺序在谷歌地图上执行。所以在动画 1 完成后,动画 2 可以继续。 这可以通过这样的回调轻松完成: googleMap.animateCamera(CameraUpdateFacto
最近我的客户想添加这样的功能:当用户有 Internet 连接时, map 会正常显示,但当用户离线启动应用程序时(即使刚刚安装后), map 不会显示,但他仍然可以看到其区域上的标记,但带有自定义背
我正在处理一个处理 map Activity 的项目。我正在运行一个由单个 Activity MaptestActivity 组成的测试应用程序,它扩展了 MapActivity 并且什么都不做。我将
在我的应用程序中,我使用 GoogleMap (play-services-maps:10.2.1)。我已将 map 的位置固定在特定位置,但我不希望我的用户能够移动 map 。我只希望他能够放大它。
我是 java 和 android 的新手。我遇到了一个基本问题。 在这个给定的 fragment 中,我可以将 GoogleMap 对象添加为 parcelable 而无需任何额外的 pracela
我用 googlemap api 制作了一个 android 应用程序,并在叠加层上绘制了一些 16x16 png(大约 200 个)。当我移动或放大/放大 map View 时,经常出现“内存不足”
我正在关注https://developers.google.com/maps/documentation/javascript/directions到目前为止, map 计算特定点之间的距离,但我需
我的 VueJS/Laravel 应用程序没有像我预期的那样正确加载到 GoogleMaps 中。我不明白为什么不调用回调。该功能可用并且应该加载。你能帮助我吗?我没有发现我的错误。我不希望看到 ma
我是一名优秀的程序员,十分优秀!