小编Muh*_*ani的帖子

如何使用react-google-maps在React.JS中获取多边形的坐标

我想获取谷歌地图上绘制的多边形的所有坐标。这是我的代码

import React from "react";
import { compose, withProps } from "recompose";
import {
  withScriptjs,
  withGoogleMap,
  GoogleMap,
  Marker
} from "react-google-maps";
//import withScriptjs from "react-google-maps/lib/async/withScriptjs";
import { DrawingManager } from "react-google-maps/lib/components/drawing/DrawingManager";

const MyMapComponent = compose(
  withProps({
    /**
     * Note: create and replace your own key in the Google console.
     * https://console.developers.google.com/apis/dashboard
     * The key "AIzaSyBkNaAGLEVq0YLQMi-PYEMabFeREadYe1Q" can be ONLY used in this sandbox (no forked).
     */
    googleMapURL:
      "https://maps.googleapis.com/maps/api/js?key=AIzaSyALpmb4KhFoR2Kcvty21gzzegprl4ilIgs&v=3.exp&libraries=geometry,drawing,places",
    loadingElement: <div style={{ height: `100%` }} />,
    containerElement: <div style={{ height: `400px` }} …
Run Code Online (Sandbox Code Playgroud)

mongoose node.js reactjs react-google-maps

1
推荐指数
1
解决办法
3451
查看次数

标签 统计

mongoose ×1

node.js ×1

react-google-maps ×1

reactjs ×1