Linux 软件免费装
Banner图

Mapsemble

开发者 mapsemble
更新时间 2026年10月23日 21:08
PHP版本: 8.0 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

map maps geolocation store locator interactive map

下载

0.5.0

详情介绍:

Mapsemble connects WordPress to the Mapsemble map service. You design the map — styling, clustering, filters, cards — in Mapsemble; this plugin puts it on a page and, when you want, feeds it from your own posts. Embed any map Every map embeds by its Mapsemble map id — with the Mapsemble Map block, the [mapsemble map="…"] shortcode, or the mapsemble_embed() template function. No setup on this site is needed: the block lists your account's maps, a typed id works for any public map, and [mapsemble map="sample"] renders a real, fully populated sample map before you have entered any credentials at all. Your account's maps are listed under Mapsemble → Maps, where locations for maps hosted on Mapsemble are edited in the Mapsemble location editor, which opens from your admin in a new tab with the map beside it — this works on a local development site too. Or build a map from this site's content Add a map under Mapsemble → Built from this site to make a post type the map's data: give posts a location and Mapsemble fetches them from a public endpoint on your site, with the cards rendered from your own templates. Always-on filters, visitor filter mappings, sort options and marker style properties shape the feed per map. This is the advanced option: it needs a publicly reachable site, and the Pro plan on the Mapsemble side — nothing is blocked before then; visitors see an upgrade notice over the map until the account is upgraded. Editing follows the data: maps hosted on Mapsemble are edited in the Mapsemble editor (opened from Mapsemble → Maps in your admin); maps built from this site are edited by editing the posts themselves. Shaping a site-fed map A map built from this site does not have to serve the whole post type: All of this lives on the map's own edit screen and applies to the feed immediately — no reindexing. Placing a map A map built from this site serves from this site however it is embedded, by its map id too — "fed by WordPress" is a property of the map, not of where you embed it. height and the two offsets take a CSS length (50vh, 480px, 2rem). scroll_capture is none or mobile, and turns the map into a sticky section: scroll gestures over it move the card list instead of the page. While scroll capture is on, the map sticks at the top offset — that is how you clear a fixed site header. While the map fills the visible screen, both offsets are also taken off its height, leaving room above and below it — as long as the minimum height leaves that room. Leave any of them out and the map keeps its own default. Two more attributes shape the embed: A Mapsemble account is required. See the External Services section for details on what data is exchanged.

安装:

  1. Install and activate the plugin.
  2. Under Mapsemble → Settings, click Authenticate on Mapsemble, approve the connection in the tab that opens, and the page finishes on its own. (You can still paste a client ID and secret by hand.)
  3. Add the Mapsemble Map block to a page and pick one of your maps — nothing else is needed. Your account's maps are listed under Mapsemble → Maps, where "Edit locations" leads to a button that opens the Mapsemble location editor in a new tab.
  4. To feed a map from this site's posts instead, go to Mapsemble → Built from this site and click Build a map from this site. Pick a map from your account, or create a new one from this screen.
  5. Pick a post type and a location source, and save. Then give your posts a location with the built-in location box (find an address, or enter latitude and longitude) or an ACF Google Map field.
  6. Embed it with the Mapsemble Map block, or with the shortcode shown on the Built from this site list: [mapsemble id="123" height="60vh"].

屏幕截图:

  • Settings once connected: how many maps your Mapsemble account holds, with reconnecting folded away.
  • A site-fed map: bound to a map on your account, it says how many of this site's posts it serves.
  • The sample map on a published page, with cards and map side by side.

升级注意事项:

0.5.0 New Map blocks insert as Wide; blocks already set to Wide or Full now render that way. With fill-viewport off, height is exact. The menu reads Maps, Built from this site, Settings. The location editor opens in a new tab, with the map beside it. 0.4.0 The shared sample map now always loads from app.mapsemble.com. A Mapsemble Map block that was placed but never given a map now shows the sample map instead of nothing. TLS is verified by default; a local stack with an untrusted certificate must define MAPSEMBLE_SSL_VERIFY as false.

常见问题:

Where does the map design come from?

From your Mapsemble account. Styling, clustering, filters and layout are configured in the Mapsemble map builder. This plugin decides only where the locations come from, and renders the content cards when they come from this site.

Who can edit a map's locations?

Editors, by default. Maintaining locations is content work, so it has its own capability (edit_mapsemble_map_data) that the administrative ones deliberately do not imply — the person adding locations does not need the screen holding your API credentials. Administrators hold both.

Can I change the card markup?

Yes. Copy templates/card.php from the plugin into your theme as mapsemble/card.php and adjust it. Developers can also use the mapsemble_card_html, mapsemble_card_css_urls and mapsemble_card_data filters.

My coordinates live in custom fields already. Can I use them?

Yes. Choose the "Custom fields (latitude/longitude meta keys)" location source and name the two meta keys — that covers Metabox.io, Pods, imported data and hand-rolled meta. An ACF Google Map field has its own named source. For computed cases, the mapsemble_post_coordinates filter remains. After switching sources, run "Reindex locations" on the map.

Is the map's interface translatable?

Yes. The widget's interface strings ("Filters", "Search", "Sort by", …) run through the plugin's mapsemble text domain, so a .po file for your language translates them; English sites send nothing extra. Developers can add or override strings with the mapsemble_widget_translations filter.

Can I develop against a local site?

A map whose locations live in Mapsemble works on a local site with no extra setup: nothing on the Mapsemble side ever fetches from your server. A map built from this site's content does not, because the Mapsemble service has to reach your feed. Expose the site through a tunnel and define MAPSEMBLE_REMOTE_BASE_URL in wp-config.php; the plugin then hands Mapsemble that address instead of your local one. Two more constants exist for people running the Mapsemble service itself locally. MAPSEMBLE_APP_BASE points the plugin at another Mapsemble host; TLS is still verified against it. MAPSEMBLE_SSL_VERIFY set to false switches that verification off — define it only for a local stack whose certificate the WordPress container does not trust, never on a public site. The sample map is the exception: it always loads from app.mapsemble.com whatever MAPSEMBLE_APP_BASE says. A stack that publishes its own copy can point it elsewhere with the mapsemble_sample_app_base filter.

Can I keep the credentials out of the database?

Yes — define MAPSEMBLE_CLIENT_ID and MAPSEMBLE_CLIENT_SECRET in wp-config.php and the settings fields become read-only. One caveat: credentials set that way never pass through the settings form, which is what normally clears the cached access token and plan details. After changing them, delete the mapsemble_token, mapsemble_token_failed, mapsemble_remote_maps, mapsemble_feature_flags and mapsemble_backoff transients — from code, \Mapsemble\Api\Client::forget_account_caches() drops exactly that set, as the settings form and the connect flow do — or the plugin keeps answering for the previous account for up to fifteen minutes.

How many posts can a map serve?

The feed is a standard WordPress meta query and is comfortable up to roughly ten thousand geo-tagged posts. Beyond that, use a persistent object cache. The entropy sort option additionally needs MySQL 8 or MariaDB 10.2 for its window function; on older databases it degrades to a stable per-map random order. The filter option pickers group over meta values, capped at ten options per lookup.

What are the public endpoints?

For site-fed maps only: mapsemble/v1/features (the GeoJSON feed), mapsemble/v1/feature (one rendered card) and mapsemble/v1/filter/options (values for a mapped filter). All serve published, geo-tagged content that the map's own conditions admit — a post excluded by an always-on filter answers 404 exactly like a missing one. Maps whose locations live in Mapsemble answer 404 on all three. Responses carry Cache-Control: public, max-age=60 and an ETag; the cache is refreshed when a served post, its terms, or the map's settings change, and developers can tune or disable it with the mapsemble_feed_cache_ttl filter.

The map preview in the block editor stays blank. Why?

The editor shows a chosen map live in a frame served by this site to a request that carries no login cookie — the block editor isolates itself in Chromium browsers, and the frame's request goes out without cookies. Anything that turns such requests away before WordPress parses them keeps the preview out: a maintenance or "members only" plugin that redirects logged-out visitors on init, or HTTP basic auth in front of a staging site. The published page is unaffected; the map still renders there.

更新日志:

0.5.0 0.4.0 0.3.0 0.2.0 0.1.1 0.1.0