# Query String Control

With this functionality, you can cause your map to open directly onto a specific marker when loaded. This might be useful if you want to have a lot of features on a map, but you still want users to be oriented to a specific marker or feature when the map loads.

Using a query string, you can set:

* Initial marker that should center and open any associated popup (`?marker_id=<id>`)
* Custom latitude and longitude (`?lat=<number>&lng=<number>`)
* Custom zoom (`?zoom=<number>`)

To use this feature, you don't need to change any settings in your map. Instead, you need to modify the URL that you provide to users or use for your links.

You can see an example of the form of the URL at our example site:

<https://wpmaps.mapster.me/examples/mapster-wp-map/printing-map/?map_id=914&marker_id=705>

The usual URL for this map is as follows:

<https://wpmaps.mapster.me/examples/mapster-wp-map/printing-map/>

So you can see that we add a query string to the URL.

This query string is in the form:

`/map_id=<map_id>&marker_id=<marker_id>`&#x20;

Or

`/map_id=<map_id>&lat=<number>&lng=<number>&zoom=<number>`

Even if there's only one map on the page, you have to specify the map\_id. You can find this on the Maps page in the Wordpress admin:

<figure><img src="/files/XF1s0bN8wVuave0bnXs5" alt=""><figcaption></figcaption></figure>

And you can find the particular ID for a given Location (marker) on the Locations admin page:

<figure><img src="/files/picZTlk70lYx9cmwQ1hH" alt=""><figcaption></figcaption></figure>

Using these two pieces of information, you just add the query string to the end of your URL, and from then on you can provide that URL to users and it will open on the specific marker you specified! It will also automatically open any popup associated with that point.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wpmaps-docs.mapster.me/maps/developer/query-string-control.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
